Skip to content

Commit a582b0a

Browse files
author
Mia
committed
add outer and scaling data [release]
1 parent 8131002 commit a582b0a

File tree

3 files changed

+25
-7
lines changed

3 files changed

+25
-7
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
"eslint": "^8.22.0"
1414
},
1515
"scripts": {
16-
"build": "node ./build/all.js",
16+
"all": "node ./build/all.js",
17+
"build": "node ./build/extension.js",
18+
"types": "node ./build/types.js",
1719
"clean": "rm ./types/.*.d.ts && rm *.zip"
1820
}
1921
}

src/extension.js

Lines changed: 21 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -644,17 +644,33 @@ class Extension extends GObject.Object {
644644

645645
#send_window_data(overlay_pressed) {
646646
const wm_class = this.#window.get_wm_class();
647-
const frame_rect = this.#window.get_frame_rect();
647+
const inner_rect = this.#window.get_frame_rect();
648+
const outer_rect = this.#window.get_buffer_rect();
649+
const scale = global.display.get_monitor_scale(this.#window.get_monitor());
650+
651+
if (DEBUG) {
652+
log_msg(`Sending data for rect inner ${inner_rect.x},${inner_rect.y},${inner_rect.width},${inner_rect.height}` +
653+
` outer ${outer_rect.x},${outer_rect.y},${outer_rect.width},${outer_rect.height} with scale ${scale}`);
654+
}
648655

649656
try {
650657
this.#socket.send(socket_encode('focusedWindowData', {
651658
'source': 'gse',
652659
'id': wm_class,
653-
'x': frame_rect.x,
654-
'y': frame_rect.y,
655-
'width': frame_rect.width,
656-
'height': frame_rect.height,
660+
'inner': {
661+
'x': inner_rect.x,
662+
'y': inner_rect.y,
663+
'width': inner_rect.width,
664+
'height': inner_rect.height,
665+
},
666+
'outer': {
667+
'x': outer_rect.x,
668+
'y': outer_rect.y,
669+
'width': outer_rect.width,
670+
'height': outer_rect.height,
671+
},
657672
'hide': overlay_pressed,
673+
scale,
658674
}), null);
659675
} catch (error) {
660676
log_msg('Failed to send a message to the socket, disconnecting.');

src/metadata.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"uuid": "[email protected]",
33
"name": "Fig GNOME Integration",
44
"url": "https://github.com/withfig/gnome-shell-extension",
5-
"version": 3,
5+
"version": 4,
66
"description": "Tightly integrates Fig with GNOME shell",
77
"gettext-domain": "fig-gnome-integration",
88
"settings-schema": "org.gnome.shell.extensions.fig-gnome-integration",

0 commit comments

Comments
 (0)