X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=src%2Fxo-callbacks.c;h=0e8e02bdc47248619def955e9cf89713cc9c575c;hb=7c3977e2b071d90aaff1f077512e6794373c4e6b;hp=7bc531a4cd0943bf31ccb7a5ee1779ac4a3cd671;hpb=7e6e62ac799f806e47f88ba0573fa320c016e8e5;p=xournal.git diff --git a/src/xo-callbacks.c b/src/xo-callbacks.c index 7bc531a..0e8e02b 100644 --- a/src/xo-callbacks.c +++ b/src/xo-callbacks.c @@ -2562,6 +2562,7 @@ on_canvas_enter_notify_event (GtkWidget *widget, dev = GDK_DEVICE(dev_list->data); gdk_device_set_mode(dev, GDK_MODE_SCREEN); } + ui.is_corestroke = ui.saved_is_corestroke; } return FALSE; } @@ -2584,6 +2585,8 @@ on_canvas_leave_notify_event (GtkWidget *widget, dev = GDK_DEVICE(dev_list->data); gdk_device_set_mode(dev, GDK_MODE_DISABLED); } + ui.saved_is_corestroke = ui.is_corestroke; + ui.is_corestroke = TRUE; } return FALSE; } @@ -2714,6 +2717,9 @@ on_canvas_motion_notify_event (GtkWidget *widget, else if (ui.cur_item_type == ITEM_RESIZESEL) { finalize_resizesel(); } + else if (ui.cur_item_type == ITEM_HAND) { + ui.cur_item_type = ITEM_NONE; + } switch_mapping(0); return FALSE; } @@ -2816,7 +2822,9 @@ on_optionsUseXInput_activate (GtkMenuItem *menuitem, non-responsive). */ +#ifndef WIN32 if (!gtk_check_version(2, 17, 0)) { +#endif /* GTK+ 2.17 and later: everybody shares a single native window, so we'll never get any core events, and we might as well set extension events the way we're supposed to. Doing so helps solve @@ -2824,14 +2832,18 @@ on_optionsUseXInput_activate (GtkMenuItem *menuitem, events in 2.18 */ gtk_widget_set_extension_events(GTK_WIDGET (canvas), ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE); +#ifndef WIN32 } else { +#endif /* GTK+ 2.16 and earlier: we only activate extension events on the canvas's parent GdkWindow. This allows us to keep receiving core events. */ gdk_input_set_extension_events(GTK_WIDGET(canvas)->window, GDK_POINTER_MOTION_MASK | GDK_BUTTON_MOTION_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK, ui.use_xinput?GDK_EXTENSION_EVENTS_ALL:GDK_EXTENSION_EVENTS_NONE); +#ifndef WIN32 } +#endif update_mappings_menu(); }