diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:11:00 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2018-09-30 14:11:00 +0200 |
commit | 0ac947a9070322180e94d1b71e30836cce4d74bc (patch) | |
tree | 4a6f3923c250377536a5004ed203768111a1d27f /src/Page.vala | |
parent | eca5837e235a356c8db9416bbbc13577db3e6f76 (diff) | |
parent | 01b2b5ec9177046f64c6d0a6e73a6ac8a42089a1 (diff) |
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'src/Page.vala')
-rw-r--r-- | src/Page.vala | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/src/Page.vala b/src/Page.vala index ea8606e..b92eaa0 100644 --- a/src/Page.vala +++ b/src/Page.vala @@ -414,9 +414,9 @@ public abstract class Page : Gtk.ScrolledWindow { int x, y; Gdk.ModifierType mask; - AppWindow.get_instance().get_window().get_device_position(Gdk.Display.get_default(). - get_device_manager().get_client_pointer(), out x, out y, out mask); - + var seat = Gdk.Display.get_default().get_default_seat(); + AppWindow.get_instance().get_window().get_device_position(seat.get_pointer(), out x, out y, out mask); + ctrl = (mask & Gdk.ModifierType.CONTROL_MASK) != 0; alt = (mask & Gdk.ModifierType.MOD1_MASK) != 0; shift = (mask & Gdk.ModifierType.SHIFT_MASK) != 0; @@ -675,8 +675,8 @@ public abstract class Page : Gtk.ScrolledWindow { return false; } - event_source.get_window().get_device_position(Gdk.Display.get_default().get_device_manager() - .get_client_pointer(), out x, out y, out mask); + var seat = Gdk.Display.get_default().get_default_seat(); + event_source.get_window().get_device_position(seat.get_pointer(), out x, out y, out mask); if (last_down.x < 0 || last_down.y < 0) return true; @@ -1083,10 +1083,7 @@ public abstract class Page : Gtk.ScrolledWindow { if (context_menu == null || !on_context_invoked()) return false; - if (event == null) - context_menu.popup(null, null, null, 0, Gtk.get_current_event_time()); - else - context_menu.popup(null, null, null, event.button, event.time); + context_menu.popup_at_pointer(event); return true; } @@ -1222,7 +1219,7 @@ public abstract class CheckerboardPage : Page { private Gtk.Viewport viewport = new Gtk.Viewport(null, null); protected CheckerboardItem anchor = null; protected CheckerboardItem cursor = null; - private CheckerboardItem highlighted = null; + private CheckerboardItem current_hovered_item = null; private bool autoscroll_scheduled = false; private CheckerboardItem activated_item = null; private Gee.ArrayList<CheckerboardItem> previously_selected = null; @@ -1446,8 +1443,8 @@ public abstract class CheckerboardPage : Page { if (cursor == item) cursor = null; - if (highlighted == item) - highlighted = null; + if (current_hovered_item == item) + current_hovered_item = null; } } @@ -1715,13 +1712,13 @@ public abstract class CheckerboardPage : Page { // if hovering over the last hovered item, or both are null (nothing highlighted and // hovering over empty space), do nothing - if (item == highlighted) + if (item == current_hovered_item) return true; // either something new is highlighted or now hovering over empty space, so dim old item - if (highlighted != null) { - highlighted.unbrighten(); - highlighted = null; + if (current_hovered_item != null) { + current_hovered_item.handle_mouse_leave(); + current_hovered_item = null; } // if over empty space, done @@ -1729,8 +1726,8 @@ public abstract class CheckerboardPage : Page { return true; // brighten the new item - item.brighten(); - highlighted = item; + current_hovered_item = item; + current_hovered_item.handle_mouse_enter(); return true; } @@ -2219,7 +2216,7 @@ public abstract class SinglePhotoPage : Page { } public Scaling get_canvas_scaling() { - return (get_container() is FullscreenWindow) ? Scaling.for_screen(get_container(), scale_up_to_viewport) + return (get_container() is FullscreenWindow) ? Scaling.for_screen(AppWindow.get_instance(), scale_up_to_viewport) : Scaling.for_widget(viewport, scale_up_to_viewport); } |