summaryrefslogtreecommitdiff
path: root/src/Page.vala
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2018-09-30 14:09:32 +0200
committerJörg Frings-Fürst <debian@jff.email>2018-09-30 14:09:32 +0200
commit0537caaf4af94a9ead8b292679f6b34c90b55e06 (patch)
tree6761cfdf959926be7af3147cf770e7f253390fe8 /src/Page.vala
parenteca5837e235a356c8db9416bbbc13577db3e6f76 (diff)
parent5e9f4eea451a77ba3b93db3747841ed2bd969e9f (diff)
Update upstream source from tag 'upstream/0.30.1'
Update to upstream version '0.30.1' with Debian dir dc242531effff8d9c6fab093414edee28b403c6a
Diffstat (limited to 'src/Page.vala')
-rw-r--r--src/Page.vala35
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);
}