Skip to content

Commit 14a1be5

Browse files
committed
WindowManager/Gestures: Use pan backend
1 parent c6709ff commit 14a1be5

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/InternalUtils.vala

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,5 +336,14 @@ namespace Gala {
336336
return { 0, 0, (int) screen_width, (int) screen_height };
337337
}
338338
}
339+
340+
public static float travel_distance_from_primary (Meta.Display display, Clutter.Orientation orientation) {
341+
var geom = display.get_monitor_geometry (display.get_primary_monitor ());
342+
if (orientation == HORIZONTAL) {
343+
return geom.width;
344+
} else {
345+
return geom.height;
346+
}
347+
}
339348
}
340349
}

src/WindowManager.vala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,9 @@ namespace Gala {
185185
screensaver.active_changed.connect (update_input_area);
186186

187187
stage = display.get_stage () as Clutter.Stage;
188+
189+
gesture_tracker.enable_pan (this, stage, () => InternalUtils.travel_distance_from_primary (get_display (), HORIZONTAL));
190+
188191
var background_settings = new GLib.Settings ("org.gnome.desktop.background");
189192
var color = background_settings.get_string ("primary-color");
190193
stage.background_color = Clutter.Color.from_string (color);

0 commit comments

Comments
 (0)