Skip to content

Commit 64c32a6

Browse files
committed
WindowClone: Fix interaction with multiple monitors
1 parent d1acdcc commit 64c32a6

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/Widgets/MultitaskingView/WindowClone.vala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,9 +245,10 @@ public class Gala.WindowClone : ActorTarget, RootTarget {
245245
}
246246

247247
var window_rect = window.get_frame_rect ();
248+
var monitor_geometry = window.display.get_monitor_geometry (window.get_monitor ());
248249

249-
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "x", typeof (float), (float) window_rect.x, (float) slot.x));
250-
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "y", typeof (float), (float) window_rect.y, (float) slot.y));
250+
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "x", typeof (float), (float) (window_rect.x - monitor_geometry.x), (float) slot.x));
251+
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "y", typeof (float), (float) (window_rect.y - monitor_geometry.y), (float) slot.y));
251252
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "width", typeof (float), (float) window_rect.width, (float) slot.width));
252253
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "height", typeof (float), (float) window_rect.height, (float) slot.height));
253254
add_target (new PropertyTarget (MULTITASKING_VIEW, this, "shadow-opacity", typeof (uint8), (uint8) 0u, (uint8) 255u));

0 commit comments

Comments
 (0)