Daemon: Workaround broken window menu for some apps (#1574)

Co-authored-by: Ryan Kornheisl <ryan@skarva.tech>
This commit is contained in:
Leo 2023-03-28 07:13:30 +09:00 committed by GitHub
parent ac73dfe017
commit 4c78a15883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 9 deletions

View File

@ -276,14 +276,21 @@ namespace Gala {
close_accellabel.accel_string = keybind_settings.get_strv ("close")[0];
}
window_menu.popup (null, null, (m, ref px, ref py, out push_in) => {
var scale = m.scale_factor;
px = x / scale;
// Move the menu 1 pixel outside of the pointer or else it closes instantly
// on the mouse up event
py = (y / scale) + 1;
push_in = true;
}, 3, Gdk.CURRENT_TIME);
// `opened` is used as workaround for https://github.com/elementary/gala/issues/1387
var opened = false;
Idle.add (() => {
window_menu.popup (null, null, (m, ref px, ref py, out push_in) => {
var scale = m.scale_factor;
px = x / scale;
// Move the menu 1 pixel outside of the pointer or else it closes instantly
// on the mouse up event
py = (y / scale) + 1;
push_in = true;
opened = true;
}, Gdk.BUTTON_SECONDARY, Gdk.CURRENT_TIME);
return opened ? Source.REMOVE : Source.CONTINUE;
});
}
public void show_desktop_menu (int x, int y) throws DBusError, IOError {
@ -354,7 +361,7 @@ namespace Gala {
// on the mouse up event
py = (y / scale) + 1;
push_in = false;
}, 3, Gdk.CURRENT_TIME);
}, Gdk.BUTTON_SECONDARY, Gdk.CURRENT_TIME);
}
}
}

View File

@ -22,6 +22,8 @@
<issues>
<issue url="https://github.com/elementary/gala/issues/913">Holding on keyboard shortcut to activate the action only once</issue>
<issue url="https://github.com/elementary/gala/issues/1229">Notification bubble appears in wrong corner on one workspace</issue>
<issue url="https://github.com/elementary/gala/issues/1347">Parity between right-clicking titlebars/headerbars on mouse and touchpad</issue>
<issue url="https://github.com/elementary/gala/issues/1387">Window menu sluggish/inoperative for apps with flathub origin</issue>
<issue url="https://github.com/elementary/gala/issues/1578">Closing a window in multitasking view closes multitasking view</issue>
<issue url="https://github.com/elementary/gala/issues/1584">When 2 windows are tiled and then resized, the inactive one gets glitched, leaving its full-sized picture as an artifact when minimized</issue>
</issues>