- Keep monitor selector for floating type

- Force monitor draggable window selection
This commit is contained in:
trigg 2022-06-23 19:02:30 +01:00
parent 491cac0bf2
commit 109225081a
2 changed files with 5 additions and 4 deletions

View file

@ -27,7 +27,7 @@ except (ImportError, ValueError):
class DraggableWindowWayland(Gtk.Window):
"""A Wayland full-screen window which can be moved and resized"""
def __init__(self, pos_x=0, pos_y=0, width=300, height=300, message="Message", settings=None, steamos=False):
def __init__(self, pos_x=0, pos_y=0, width=300, height=300, message="Message", settings=None, steamos=False, monitor=None):
Gtk.Window.__init__(self, type=Gtk.WindowType.TOPLEVEL)
self.pos_x = pos_x
self.pos_y = pos_y
@ -43,13 +43,14 @@ class DraggableWindowWayland(Gtk.Window):
self.connect('button-release-event', self.button_release)
self.set_app_paintable(True)
self.monitor = 0
self.drag_type = None
self.drag_x = 0
self.drag_y = 0
if GtkLayerShell:
GtkLayerShell.init_for_window(self)
if monitor:
GtkLayerShell.set_monitor(self,monitor)
GtkLayerShell.set_layer(self, GtkLayerShell.Layer.TOP)
GtkLayerShell.set_anchor(self, GtkLayerShell.Edge.LEFT, True)
GtkLayerShell.set_anchor(self, GtkLayerShell.Edge.RIGHT, True)

View file

@ -161,7 +161,8 @@ class SettingsWindow(Gtk.VBox):
pos_x=self.floating_x, pos_y=self.floating_y,
width=self.floating_w, height=self.floating_h,
message=_("Place & resize this window then press Green!"), settings=self,
steamos=self.discover.steamos)
steamos=self.discover.steamos,
monitor=self.get_monitor_obj(self.monitor))
else:
self.placement_window = DraggableWindow(
pos_x=self.floating_x, pos_y=self.floating_y,
@ -197,7 +198,6 @@ class SettingsWindow(Gtk.VBox):
self.save_config()
self.align_x_widget.hide()
self.align_y_widget.hide()
self.align_monitor_widget.hide()
self.align_placement_widget.show()
def change_monitor(self, button):