Mentions légales du service

Skip to content
Snippets Groups Projects
Commit 14b3003d authored by Florent Bouchez Tichadou's avatar Florent Bouchez Tichadou
Browse files

Merge branch 'dev/xdotool-bis' into 'main'

Merge xdotool-bis into main

See merge request !15
parents 3fb1723a fce6ae43
No related branches found
No related tags found
1 merge request!15Merge xdotool-bis into main
......@@ -54,7 +54,7 @@ class NoServerWindow(GenServerWindow):
self._window_title = "NoServerWindow"
pos_re = re.compile(r'Position: (\d+),(\d+) ')
pos_re = re.compile(r'Position: (-?\d+),(-?\d+)')
geom_re = re.compile(r'Geometry: (\d+)x(\d+)')
wid_re = re.compile(r'WID: (\d+)\n')
dimen_re = re.compile(r'dimensions: +(\d+)x(\d+) pixels')
......@@ -99,7 +99,7 @@ class ServerWindow(GenServerWindow):
map(int, m[-1])
)
# print ("SCREEN DIMENSIONS", self._screen_width, self._screen_height, self._screen_offset_x)
log.debug(f"Screen dimensions : {self._screen_width, self._screen_height, self._screen_offset_x}")
self.xdotool = shutil.which("xdotool")
if not self.xdotool:
......@@ -175,7 +175,7 @@ class ServerWindow(GenServerWindow):
f"xdotool cannot find position for {winid} window! (output was {x.stdout.decode()})"
)
return 0, 0, 0, 0
return
xpos, ypos = list(map(int, m.groups()))
log.debug(f"Position found for {winid} window: {xpos, ypos}")
m = geom_re.search(x.stdout.decode())
......@@ -186,7 +186,7 @@ class ServerWindow(GenServerWindow):
return 0, 0, 0, 0
return
width, height = list(map(int, m.groups()))
log.debug(f"Geometry found for {winid} window: {width, height}")
log.debug(f"Geometry found for {winid} window: {width}x{height}")
return xpos, ypos, width, height
......@@ -198,12 +198,14 @@ class ServerWindow(GenServerWindow):
self.get_agdb_window_id()
# ax, ay, awidth, aheight = self.get_window_geometry(self._agdbwindow_id)
log.debug("SCANNING FOR AGDBENTURES WINDOW DATA")
ax, ay = self.agdb_window.get_location()
log.debug(f"Position found for {self._agdbwindow_id} window : {ax, ay}")
awidth = self.agdb_window.width
aheight = self.agdb_window.height
# print ("LOCATION: ", x, y, ax, ay)
log.debug(f"Geometry found for {self._agdbwindow_id} window : {awidth}x{aheight}")
log.debug("SCANNING FOR VIM CODE WINDOW DATA")
cx, cy, cwidth, cheight = self.get_window_geometry()
# snap code window on the left side of agdbentures window
......@@ -213,11 +215,7 @@ class ServerWindow(GenServerWindow):
# new_cwidth = 400
new_cwidth = cwidth # we do not resize, but this might change in the future
self.resize_window(
new_cwidth, aheight
) # resize to same height as arcade window
border_x = 3
border_x = 5
new_ypos = 0 + 20
if (
......@@ -237,14 +235,19 @@ class ServerWindow(GenServerWindow):
new_ypos,
winid=self._agdbwindow_id,
)
# print("MOVING VIM TO", (new_xpos, new_ypos))
# print("MOVING AGDB TO", (new_xpos - cst.Win.INIT_W, new_ypos))
elif GenServerWindow.window_alignment == 'left':
new_xpos = self._screen_offset_x + border_x
## moving code window to the left edge of the screen, and agdb window on the left of it
self.move_window(new_xpos, new_ypos, winid=self._agdbwindow_id)
self.move_window(new_xpos + cst.Win.INIT_W + border_x, new_ypos)
# we do not resize, but this might change in the future
self.resize_window(
new_cwidth, aheight
) # resize to same height as arcade window
log.debug(f"Resized {self._window_id} window : from {cwidth}x{cheight} to {new_cwidth}x{aheight}")
# self.move_window(ax - new_cwidth//2, new_ypos)
# self.move_window(ax + new_cwidth//2, new_ypos, winid=self._agdbwindow_id)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment