Zotero Preferences Window Issue with Tiling Window Managers

I'm using the Zotero desktop application version 5.0.84 on GNU/Linux with a tiling window manager. My tiling window manager resizes Zotero's preferences window to its current layout, but it seems that the preferences window wasn't designed to work at any other than its default size. Using the resized preferences window results in rather unpleasant display artefacts.

There are two ways to resolve the issue. One way is to fix the preferences window to support resizing. The other (much simpler) solution is for the preferences window to set the appropriate window type such that tiling window managers treat the window as a floating window and don't attempt to resize it. Other Zotero windows in fact already do this, for example the "Help -> Report Errors..." window or the "Help -> About Zotero" window.

The window types are documented here:

https://specifications.freedesktop.org/wm-spec/latest/ar01s05.html#idm46094431857712

The preferences window sets its _NET_WM_WINDOW_TYPE to _NET_WM_WINDOW_TYPE_NORMAL, but it should set to _NET_WM_WINDOW_TYPE_DIALOG like the "Repor Errors..." and "About Zotero" windows do. I'm pretty sure that mainstream GUI toolkits such as GTK and Qt offer simple means to specify whether the opened window is "normal" or if it's a dialog window. So fixing the issue should be a matter of giving the preferences window the appropriate window type.
  • We don't deal with windows at that level. Zotero is based on Firefox, and we just open a XUL prefwindow with openDialog(). (prefwindows are no longer used in current Firefox versions, but it should work the way the Firefox/Thunderbird preferences did in older versions before they switched to the vertical page layout.)

    The preferences will be a resizable HTML window in a future version, so this will likely be fixed at that point.
  • Thanks for the links. It's good to know that the issue will be eventually solved by rewriting the preferences as an HTML window.

    I still suspect that the preferences window is currently being opened in a slightly different way than it should though. Let me remind that many other Zotero dialog windows set _NET_WM_WINDOW_TYPE_DIALOG and are handled correctly by my tiling window manager, for example:

    File -> New Collection...
    File -> Import...
    File -> Export Library...
    Tools -> Addons
    Help -> Report Errors
    Help -> About Zotero

    Examples of windows that instead set _NET_WM_WINDOW_TYPE_NORMAL are (apart from the preferences window):

    Help -> Check for Updates...
    Advanced Search

    All that is needed is for the preferences window to be opened 'in the same way' as the first list of windows. I've looked at the code you linked, I've searched a bit through Zotero's source code on Github and it seems that this could be related to the preferences window setting the 'dialog=no' window feature. Could this be the culprit? Going through XUL's documentation didn't really make it clear to me what the 'dialog' window feature does exactly. Please note that searching zotero/zotero on Github for 'dialog=yes' yields code of some of the windows that set _NET_WM_WINDOW_TYPE_DIALOG (about.xul and importWizard.xul) whilst searching for 'dialog=no' returns the Advanced Search window.
  • edited 6 days ago
    OK, try the latest Zotero beta. More details in the commit.
    Going through XUL's documentation didn't really make it clear to me what the 'dialog' window feature does exactly.
    Some details here. Going by resizability and minimizability, I'd say, of the ones you list above, Tools → Add-ons should be normal and Help → "Check for Updates…" should be a dialog. Not clear that Preferences should stay in front or be non-minimizable, but certainly it shouldn't be resizable, so for that reason alone dialog seems best.
  • OK, try the latest Zotero beta. More details in the commit.
    Thanks, the beta version fixes the problem.

    Just to clear up one thing from the commit message:
    [...] but on Linux `dialog=no` allows the dialog to be resized, which it shouldn't be, and [...]
    The preferences window with dialog=no gets managed by the tiling window manager in a way which force-resizes the window into the dimensions that the window manager sees fit. Once I used a keyboard shortcut to tell the window manager to stop tiling the pref window and instead manage the window like nontiling window managers do (this is called floating mode), the preferences window jumped back into the size it's supposed to have. When I tried to resize the pref window managed in floating mode, the window always immediately jumped back into its 'default' size. Zotero beta now specifies that the pref window is a dialog window and the tiling window manager identifies it as such; therefore the perf window doesn't get tiled (and force resized) and instead it's left as an unmanaged floating window. I'm pretty sure this behaviour isn't specific to the window manager I use (i3), but it's the way most, if not all, tiling window managers do it.
    Some details here. Going by resizability and minimizability, I'd say, of the ones you list above, Tools → Add-ons should be normal and Help → "Check for Updates…" should be a dialog. Not clear that Preferences should stay in front or be non-minimizable, but certainly it shouldn't be resizable, so for that reason alone dialog seems best.
    Thanks for the link. I think that I agree that changing Tools → Add-ons to be a normal window and Help → Check for Updates… to a dialog window seems to make sense.
  • Re: resizing, as documented in the Mozilla link, an effect of dialog=no is that it adds a maximize button, and in a normal window manager that creates a huge window without resizing the contents. That's obviously not desired, and that's what I was referring to. (I didn't test whether the window could also be manually resized.)
Sign In or Register to comment.