Cannot type or use Shortcuts in Citation Selector

## Description

TL;DR: I have to set the Citation Dialog to keep above other windows, but it won't focus into the citation dialog (can't type characters) unless I right-click.
When I enable "keep above other windows" in the window settings of my OS or enable `extensions.zotero.integration.keepAddCitationDialogRaised` in the config editor of Zotero, I have to right-click the red Citation Dialog bar in order to interact with it with my keyboard.
- I learned about the `...keepAddCitationDialogRaised` solution from this [article](https://medium.com/obsidian-observer/zotero-citation-selector-window-appearing-behind-focused-window-solved-c47b669fb75a).
- The interactions I'm referring to is typing the title or author of the citation I'm looking for and accessing the keyboard shortcuts like `down arrow` to go through the suggested citations, `enter` to select a citation, and `enter` to add the selected citation to my document.
- If I do not right-click the Citation Dialog bar, I'll only be able to `left click` the default suggestion (what I already have open in Zotero) and `left click` the arrow to add the selected citation to my document.

If I do not have the Citation Dialog raised or set to keep above other windows, I have to find the application in my application hot bar, click it and proceed to (no need to right-click it) type, select and add my citation with the mouse or keyboard.

Notes:
- The Citation Dialog is also known as the Citation Selector Window, Add/Edit Citation in Word, Zotero Pop-up Box, Citation Red Bar, or the Citation Insert Bar.
- The Citation Dialog, when opened, will allow the user to use "keyword/author searching to find the article you're looking for. A list of matching citations will pop up below the search box." Users can select the appropriate citation(s) to add them into their document, usually with a third party tool.

Excuse over explaining the problem and the additional context. It's so the keywords are there in case anyone else has the same or a similar problem.

## Environment:

- OS: MX x86_64 (based on Debian)
- Browser: Vivaldi (7.0.3495.29 (Stable channel) stable (64-bit) ) & Brave (1.74.48 Chromium: 132.0.6834.83 (Official Build) unknown (64-bit) )
- Web Clipper version: 0.10.7
- Obsidian version: v1.7.7 (deb installation (NOT an AppImage) )

## Context

I'm using [Obsidian](https://obsidian.md) and the [Zotero Integration](https://github.com/mgmeyers/obsidian-zotero-integration) plugin. The Zotero Integration plugin uses the Zotero Citation Dialog to select a citation to apply a template I made. This creates a Literature note that has the metadata of the citation I selected in the format I specified in my template.

## Steps to Reproduce

I really have no idea. Apparently, having to raise the Citation Dialog window appears to be a problem only some people have. So only someone who has had the same problem, seen a similar problem, know a possible workaround, or have enough background knowledge to know how to proceed from here.

## Attempted Solutions

- I tried some of the other options in the Windows Rules like "Accept Focus", "Focus Protection", "Focus Stealing Protection", "No Title Bar and Frame", and of course "Keep Above Other Windows".
- I tried combinations with this and enabling `extensions.zotero.integration.keepAddCitationDialogRaised` in Zotero
- I tried enabling the Classic view of the Citation Dialog by enabling `extensions.zotero.integration.useClassicAddCitationDialog` but I get the same problems with the default view where I have to right-click into it with my mouse to interact with it through my keyboard.
- I tried looking for a relevant option in the Config editor by searching the keywords "Citation" and "Dialog" but didn't find anything I was too confident in playing with.
- Restarting Zotero.
- Restarting Obsidian.
- Restarting my Laptop.

## Potential Solutions

- Maybe there's an option in the Config editor made for people with this specific issue?
- Maybe there's a keyboard shortcut to right-click focus on a window that has the "focus" (I'm assuming it has the focus, but I guess it technically does not since I have to right-click into it)

## Relevant Links:

Article `extensions.zotero.integration.keepAddCitationDialogRaised` is from: https://medium.com/obsidian-observer/zotero-citation-selector-window-appearing-behind-focused-window-solved-c47b669fb75a
Obsidian: https://obsidian.md
Zotero Integration: https://github.com/mgmeyers/obsidian-zotero-integration
Learn more about the Linux KDE Window Rules here:
- KDE Docs Website (split up into sub-pages): https://docs.kde.org/stable5/en/kwin/kcontrol/windowspecific/index.html
- As a PDF (takes a little long to load but easier to navigate): https://docs.kde.org/stable5/en/kwin/kcontrol/windowspecific/index.html
  • Can you replicate this using only Zotero-provided software, with LibreOffice or Google Docs and with all plugins disabled?
  • @dstillman
    I don't use LibreOffice or Google Docs, so I didn't instinctively test the issue on them. But I can give them a test some time tomorrow.
  • @dstillman
    I have the same issue in Google Docs.
    As you can see from the image below, I have to raise the Citation Dialog to the front:
    https://s3.amazonaws.com/zotero.org/images/forums/u16255424/zjz0mvkmwx4bjr684dvh.png

    It would be clearer with a video, but in the image below, when the Citation Dialog is raised, it is not blinking:
    https://s3.amazonaws.com/zotero.org/images/forums/u16255424/tbcim1srerpvasusos74.png

    Also, small edit to my original post, I can `left-click` now to be able to type into the search bar of the citation dialog. I swear I spammed the `left-click` button yesterday, but I could be mistaken or got confused with something else. I can now `left-click` and `right-click` to interact with the Citation Dialog with the keyboard.

    Should I also test this on LibreOffice? I'm pretty sure it will have the same issue.
  • To start with, the "keep raised" or "keep above other windows" options are not going to be relevant, since you need the dialog to receive focus. A window can be pinned above other windows without having focus, which is your primary issue.

    Now, generally window handling is done by the OS and Zotero has somewhat limited control over whether it can successfully raise itself. Zotero is based on Firefox and the Firefox code issues the relevant commands to the OS to tell it that it wants a window to appear and get focus. It's up to the OS to listen to those. However, with the switch from Zotero 6 to Zotero 7 we also upgraded the underlying version of Firefox. This version supports Wayland better, but possibly X worse, so if you are using X it might be worth to try switching to Wayland. Furthermore, sometimes OSes have heuristics about focusing windows depending on the parent window state, so if you are minimizing Zotero, you should avoid that and instead switch focus to the relevant app, which might help to focus the citation dialog upon opening.
  • @adomasven
    Yes I understand. I just want to make sure I cover all my bases and mention additional configurations I made.

    This time, I made sure I didn't minimize Zotero, but the issue still persists.

    I thought I was using Wayland this whole time, ha ha. I just checked and apparently I'm using X11. I'll switch over when KDE plasma 6 comes out in the next Debian release which is projected to be around the Summer or after when I do a reinstallation.

    For now, I'd like to ask for help with a workaround in X11. I don't mind installing additional programs that can help with this. Since testing this issue and documenting it, I got a better understand of the relevant keywords, so I'll spend another session looking for solutions with adding a focus to an application or maybe an add-on to the window rules.
  • @adomasven @dstillman
    I've found a workaround.
    Here's the configuration:
    Window Management > Window Behavior > Focus stealing prevention > Change from "Low" to "None"

    And here's a screenshot of what the settings page looks like:
    https://s3.amazonaws.com/zotero.org/images/forums/u16255424/jvbi9q0ehy81bsn1wfov.png

    It appears the Citation Dialog was trying to take the focus, which also means it's not bugged in X11. The global setting "Focus stealing prevention" needs to be changed from low (which is low) to none. So my guess is Zotero doesn't set it to a "High" force focus for it to bypass the low focus stealing prevention. But of course x11 could be doing something that

    I haven't seen this issue posted anywhere else, but do you think I should post this in the GitHub? I made sure the keywords made sense, so someone should find it here if not.
  • edited 2 days ago
    Thanks to EnriqueTMT for returning with a workaround to report. Experiencing a similar issue in Obsidian with KDE 5.27.11 which is not solved by the workaround. If admins see this thread, please don't ignore it since it has a workaround. I don't want to start a new thread which is likely a duplicate of this live one.

    Edit: noted that the issue is also in Obsidian.
  • @hone9226

    I'm glad you found the post at least! I try my best to put as many keywords in my tickets, since I know how difficult it is to find relevant search results.

    But I came here to remind you to confirm a few things so they have some more info to go off.
    - You shared your desktop environment, but maybe also share your distribution.
    - dstillman asked me to test the issue on LibreOffice and Google Docs, so let them know that you've tried this.
    - You said a similar issue. I think you should be more specific. Is there something different, or is it actually the same issue? Even then, writing out the symptoms of your issue helps them confirm that this is the same issue.
    - Of course your version of Obsidian. And whether it's an app image, .deb file, or anything else.
    - Confirm whether you're using x11 or Wayland. adomasven said that might be an issue.
    - Have you tried raising the window with the config editor and the window rules? Or just one of them? I'm pretty sure they're the same thing, but I'd mention this.

    This is so whom ever comes to help has a bit more to go off when recommending solutions. It's also in case someone else passes by with the same issue. There may be a pattern somewhere in the answers above.

    Also, I didn't finish doing all the research I planned for this bug since the workaround I mentioned above was the first one I tried after adomasven's comment and it worked. So I recommend seeing there are any additional packages you can install, if there's anything else you can do in the Windows Behavior, or if there are any add-ons to the window rules (I doubt it, but it's worth trying).
    Perplexity.ai didn't help me with this issue, but maybe it'll help with searching for the things I mentioned above. Sometimes Perplexity cooks up real solutions. But it's an AI, so don't have any expectations.
  • Thanks for reminding me to revisit this Enrique. Apologies for not posting a detailed bug report earlier, as I was not certain that it was appropriate on this forum to double up on reports. This also slipped through the crack as work picked up in the afternoon.

    ## Environment

    -------------
    OS: Kubuntu 24.04.1 LTS x86_64
    Host: TITAN Standard
    Kernel: 6.8.0-48-generic
    Uptime: 60 days, 7 hours, 18 mins
    Packages: 4692 (dpkg), 12 (flatpak), 22 (snap)
    Shell: bash 5.2.21
    Resolution: 3840x2160, 3840x2160, 2560x1440
    DE: Plasma 5.27.11
    WM: KWin
    Theme: [Plasma], Breeze [GTK2/3]
    Icons: [Plasma], breeze-dark [GTK2/3]
    Terminal: konsole
    Terminal Font: Hack 12
    CPU: AMD Ryzen 9 5900HX with Radeon Graphics (16) @ 4.680GHz
    GPU: AMD ATI Radeon Vega Series / Radeon Vega Mobile Series
    GPU: NVIDIA GeForce RTX 3070 Mobile / Max-Q
    Memory: 11034MiB / 63698MiB
    -------------
    $ echo $XDG_SESSION_TYPE
    x11
    -------------
    Zotero v7.0.8
    Enabled plugins:
    - Better BibTex for Zotero v7.0.5
    - Zotero OCR v0.8.1
    -------------
    Obsidan v1.8.4 (AppImage)
    Obsidian Zotero Integration v3.2.1
    Other Obsidian extensions installed:
    - Archiver v0.26.1
    - Calendar v1.5.10
    - Dataview v0.5.67
    - Hotkeys++ v0.2.7
    - Markwhen v0.0.3
    - Tasks v7.12.1
    - Templater v2.9.0
    -------------
    LibreOffice
    Version: 24.8.4.2 (X86_64) / LibreOffice Community
    Build ID: 480(Build:2)
    CPU threads: 16; OS: Linux 6.8; UI render: default; VCL: gtk3
    Locale: en-US (en_US.UTF-8); UI: en-US
    Ubuntu package version: 4:24.8.4~rc2-0ubuntu0.24.04.1~lo1
    Calc: threaded

    ## Context

    Same as Enrique, I noticed this issue on Obsidian using the Zotero integration plugin. I can recreate a similar issue in both Zotero and LibreOffice.

    ## Issue Description

    The original issue I was experiencing was a frustrating pop-under behavior of the Zotero integration red rounded-rectangle. I used the keepAddCitationDialogRaised trick to prevent the pop-under behavior. Similar to Enrique, I cannot interact much with the rectangle. See example from LibreOffice:

    https://s3.amazonaws.com/zotero.org/images/forums/u1507615/y97wdh2l73vfd4527j02.png

    After the red rectangle pops up when clicking “Add/Edit Citation”, I cannot interact with the rectangle. I cannot type anything in the search bar, only in the document. The only parts I can interact with on the popup are the red Z, the pre-selected citation, and the “submit” arrow. All typing appears on the document. I cannot even close the window. Short of aggressive approaches to kill it, the integration persists after Zotero and LibreOffice are normally exited.

    Accessing Classic View with the red Z allows me to interact with the popup normally, including an appropriate exit.

    ## Attempted Solutions

    ### copied relevant from Enrique

    - I tried some of the other options in the Windows Rules like "Accept Focus", "Focus Protection", "Focus Stealing Protection", "No Title Bar and Frame", and of course "Keep Above Other Windows".
    - I tried combinations with this and enabling `extensions.zotero.integration.keepAddCitationDialogRaised` in Zotero
    - Restarting Zotero.
    - Restarting Obsidian.

    ### not mentioned by Enrique

    - I enabled classic view in Zotero but this seemed to bypass the keepAddCitationDialogRaised setting and changed things back to the undesirable pop-under.
    - I performed some aggressive ``kill -9`` sweeps.
    - I killed and restarted Plasma

    ## Differences from Enrique's example

    A right-click on the integrator popup does nothing for me.
Sign In or Register to comment.