diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-19 17:00:18 +0300 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2025-04-19 17:00:18 +0300 |
commit | 29f1dea16c4ffa21926ccdc5a3b3c73a56d9437a (patch) | |
tree | d862e31fc92d56a82b18e78c6ee8af24623489a8 | |
parent | c3b9b3b56edc61aa82cca38bdc64e2f463551456 (diff) | |
download | sciteco-29f1dea16c4ffa21926ccdc5a3b3c73a56d9437a.tar.gz |
Gtk: fixed setting the mouse cursor after changing the active buffer
* The GdkWindow stacking order obviously got messed up when swapping out
the child widget in the GtkEventBox.
* This was probably also responsible for input events coming through
to the Scintilla view even though the GtkEventBox should block all
input events from reaching the Scintilla view.
The event masking in teco_view_new() is probably no longer necessary -
but better keep it to be on the safe side.
-rw-r--r-- | src/interface-gtk/interface.c | 8 | ||||
-rw-r--r-- | src/interface-gtk/view.c | 6 |
2 files changed, 12 insertions, 2 deletions
diff --git a/src/interface-gtk/interface.c b/src/interface-gtk/interface.c index db70f20..045f9d7 100644 --- a/src/interface-gtk/interface.c +++ b/src/interface-gtk/interface.c @@ -876,9 +876,15 @@ teco_interface_refresh(gboolean current_view_changed) teco_interface.current_view_widget = GTK_WIDGET(teco_interface_current_view); + /* + * NOTE: The hiding helps to ensure the correct GdkWindow + * ordering, which is important at least for setting the + * mouse cursors. + */ + gtk_widget_hide(teco_interface.event_box_widget); gtk_container_add(GTK_CONTAINER(teco_interface.event_box_widget), teco_interface.current_view_widget); - gtk_widget_show(teco_interface.current_view_widget); + gtk_widget_show_all(teco_interface.event_box_widget); } } diff --git a/src/interface-gtk/view.c b/src/interface-gtk/view.c index 5bc4b61..81db3d7 100644 --- a/src/interface-gtk/view.c +++ b/src/interface-gtk/view.c @@ -91,8 +91,12 @@ teco_view_new(void) /* * This disables mouse and key events on this view. - * For some strange reason, masking events on + * + * FIXME: For some strange reason, masking events on * the event box does NOT work. + * This might have been a bug in GdkWindow stacking + * when swapping out the GtkEventBox's child. + * Still, better be on the safe side. */ gtk_widget_set_can_focus(GTK_WIDGET(ctx), FALSE); gint events = gtk_widget_get_events(GTK_WIDGET(ctx)); |