mirror of
https://github.com/zotero/zotero.git
synced 2026-09-28 01:31:40 +00:00
Do not attempt to activate windows on wayland using X11 libraries
I don't know if something changed in my Ubuntu installation or in the Firefox runtime (probably the former), but that code crashes Zotero on wayland. Window activation (e.g. citation window) does not seem to be affected.
This commit is contained in:
parent
e765a4d3af
commit
d231fb3b53
1 changed files with 10 additions and 2 deletions
|
|
@ -2606,6 +2606,14 @@ Zotero.Utilities.Internal.activate = new function () {
|
|||
}
|
||||
|
||||
return function (win) {
|
||||
let isWayland = true;
|
||||
if (Zotero.isLinux) {
|
||||
try {
|
||||
let sessionType = Services.env.get('XDG_SESSION_TYPE');
|
||||
isWayland = sessionType === 'wayland';
|
||||
}
|
||||
catch (e) {}
|
||||
}
|
||||
if (Zotero.isMac) {
|
||||
if (win) {
|
||||
Components.utils.import("resource://gre/modules/ctypes.jsm");
|
||||
|
|
@ -2655,7 +2663,7 @@ Zotero.Utilities.Internal.activate = new function () {
|
|||
Zotero.Utilities.Internal.executeAppleScript(script);
|
||||
}
|
||||
}
|
||||
else if (Zotero.isLinux && win) {
|
||||
else if (Zotero.isLinux && !isWayland && win) {
|
||||
Components.utils.import("resource://gre/modules/ctypes.jsm");
|
||||
|
||||
if (_x11 === false) return;
|
||||
|
|
@ -2867,7 +2875,7 @@ Zotero.Utilities.Internal.activate = new function () {
|
|||
}, 50);
|
||||
}, false);
|
||||
}
|
||||
else if (Zotero.isWin && win) {
|
||||
else if ((Zotero.isWin || Zotero.isLinux) && win) {
|
||||
// Try to focus the window. This is necessary as focusing a node inside
|
||||
// of the window may not necessarily activate the window.
|
||||
win.focus();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue