Skip to content

Commit 097d317

Browse files
committed
app/window: always use cached TargetRect value
1 parent d7469b8 commit 097d317

File tree

2 files changed

+7
-17
lines changed

2 files changed

+7
-17
lines changed

ddterm/app/appwindow.js

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -375,23 +375,11 @@ class DDTermAppWindow extends Gtk.ApplicationWindow {
375375

376376
this.display_config.update_sync();
377377

378-
const rect_type = new GLib.VariantType('(iiii)');
379-
380378
const dbus_handler = this.extension_dbus.connect(
381379
'g-properties-changed',
382-
(_, changed, invalidated) => {
383-
if (this.visible)
384-
return;
385-
386-
if (invalidated.includes('TargetRect')) {
380+
() => {
381+
if (!this.visible)
387382
this.sync_size_with_extension();
388-
return;
389-
}
390-
391-
const value = changed.lookup_value('TargetRect', rect_type);
392-
393-
if (value)
394-
this.sync_size_with_extension(value.deepUnpack());
395383
}
396384
);
397385

@@ -596,12 +584,14 @@ class DDTermAppWindow extends Gtk.ApplicationWindow {
596584
return false;
597585
}
598586

599-
sync_size_with_extension(rect = null) {
587+
sync_size_with_extension() {
600588
if (this.is_maximized)
601589
return;
602590

591+
const rect = this.extension_dbus.TargetRect;
592+
603593
if (!rect)
604-
rect = this.extension_dbus.GetTargetRectSync();
594+
return;
605595

606596
let [target_x, target_y, target_w, target_h] = rect;
607597

ddterm/app/extensiondbus.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ export function create_extension_dbus_proxy() {
3232
'/org/gnome/Shell/Extensions/ddterm',
3333
undefined,
3434
undefined,
35-
Gio.DBusProxyFlags.DO_NOT_AUTO_START
35+
Gio.DBusProxyFlags.DO_NOT_AUTO_START | Gio.DBusProxyFlags.GET_INVALIDATED_PROPERTIES
3636
);
3737
}

0 commit comments

Comments
 (0)