From 6fc47b613fb0b33b4866a5e54c231e9426e2ca3d Mon Sep 17 00:00:00 2001 From: John Smith Date: Wed, 11 Jul 2012 09:42:57 +0900 Subject: Fix for 167781 : opacity in selected style loses focus on kbd value scroll, fix for Esc (bzr r11540) --- src/ui/widget/selected-style.cpp | 1 + src/widgets/spinbutton-events.cpp | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 88341a0e8..867ec62a9 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -338,6 +338,7 @@ SelectedStyle::SelectedStyle(bool /*layout*/) _opacity_sb.signal_value_changed().connect(sigc::mem_fun(*this, &SelectedStyle::on_opacity_changed)); // Connect to key-press to ensure focus is consistent with other spin buttons when using the keys vs mouse-click g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "key-press-event", G_CALLBACK (spinbutton_keypress), _opacity_sb.gobj()); + g_signal_connect (G_OBJECT (_opacity_sb.gobj()), "focus-in-event", G_CALLBACK (spinbutton_focus_in), _opacity_sb.gobj()); _fill_place.add(_na[SS_FILL]); _fill_place.set_tooltip_text(__na[SS_FILL]); diff --git a/src/widgets/spinbutton-events.cpp b/src/widgets/spinbutton-events.cpp index 7f1a1f8c6..290b0bb75 100644 --- a/src/widgets/spinbutton-events.cpp +++ b/src/widgets/spinbutton-events.cpp @@ -43,7 +43,9 @@ void spinbutton_undo (GtkWidget *w) { gdouble *ini = (gdouble *) g_object_get_data(G_OBJECT (w), "ini"); - gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), *ini); + if (ini) { + gtk_spin_button_set_value(GTK_SPIN_BUTTON(w), *ini); + } } void -- cgit v1.2.3