- Fix wayland window placement

This commit is contained in:
Trigg 2022-07-19 08:45:22 +00:00
parent cd65755314
commit fbe205f62e
2 changed files with 10 additions and 4 deletions

View file

@ -50,7 +50,7 @@ class DraggableWindowWayland(Gtk.Window):
if GtkLayerShell:
GtkLayerShell.init_for_window(self)
if monitor:
GtkLayerShell.set_monitor(self,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)
@ -109,7 +109,7 @@ class DraggableWindowWayland(Gtk.Window):
self.drag_type = 1
# Where in the window did we press?
if press_x < 20 and press_y < 20:
self.settings.change_placement(None)
self.settings.change_placement(self)
if press_y > self.height - 32:
self.drag_type += 2
if press_x > self.width - 32:

View file

@ -589,7 +589,7 @@ class MainSettingsWindow():
width=self.voice_floating_w, height=self.voice_floating_h,
message=_("Place & resize this window then press Green!"), settings=self,
steamos=self.steamos,
monitor=self.get_monitor_obj(self.monitor))
monitor=self.get_monitor_obj(self.widget['voice_monitor'].get_active_text()))
else:
self.voice_placement_window = DraggableWindow(
pos_x=self.voice_floating_x, pos_y=self.voice_floating_y,
@ -634,7 +634,7 @@ class MainSettingsWindow():
width=self.text_floating_w, height=self.text_floating_h,
message=_("Place & resize this window then press Green!"), settings=self,
steamos=self.steamos,
monitor=self.get_monitor_obj(self.monitor))
monitor=self.get_monitor_obj(self.widget['text_monitor'].get_active_text()))
else:
self.text_placement_window = DraggableWindow(
pos_x=self.text_floating_x, pos_y=self.text_floating_y,
@ -643,6 +643,12 @@ class MainSettingsWindow():
if button:
button.set_label(_("Save this position"))
def change_placement(self, placement_window):
if placement_window == self.text_placement_window:
self.text_place_window(None)
elif placement_window == self.voice_placement_window:
self.voice_place_window(None)
def text_server_refresh(self, button):
with open(self.rpc_file, 'w') as f:
f.write('--rpc --refresh-guilds')