Summary: | LibreOffice windows and dialogs do not receive focus on open, hiding inside minimised parent instances | ||
---|---|---|---|
Product: | [Plasma] kwin | Reporter: | Bernard Gray <bernard.gray> |
Component: | core | Assignee: | KWin default assignee <kwin-bugs-null> |
Status: | RESOLVED WORKSFORME | ||
Severity: | wishlist | CC: | cfeck, dolgener, MurzNN |
Priority: | NOR | ||
Version: | 4.11.11 | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
URL: | https://drive.google.com/file/d/0BxhtBAYzjZj5ODZ2RG1GZHZtUEE/edit?usp=sharing | ||
See Also: | https://bugs.kde.org/show_bug.cgi?id=339635 | ||
Latest Commit: | Version Fixed In: | ||
Attachments: | Sample CSV file from Wikipedia |
Description
Bernard Gray
2014-10-03 01:22:45 UTC
Created attachment 88932 [details]
Sample CSV file from Wikipedia
Reproducible with 4.14.1 and LibreOffice 4.3.2.2. When right-clicking the file, use "Open With > LibreOffice Calc", not Writer. LibreOffice "demands attention", though, at least the panel unhides. It looks like Unity catches the new dialog on the minimized window, and forces a restore. Should be solvable with a KWin script, e.g. workspace.clientAdded.connect(function(client) { client.minimized = false; }); Bernard, to test KWin scripts, type this in Konsole: qdbus org.kde.plasma-desktop /MainApplication showInteractiveKWinConsole Then an Editor/Output window appears. Paste the above 3-line script there, and click "Execute". Then try to reproduce again. Thomas might provide an improved and installable version. (In reply to Christoph Feck from comment #2) > Reproducible with 4.14.1 and LibreOffice 4.3.2.2. > > When right-clicking the file, use "Open With > LibreOffice Calc", not Writer. > > LibreOffice "demands attention", though, at least the panel unhides. It > looks like Unity catches the new dialog on the minimized window, and forces > a restore. Should be solvable with a KWin script, e.g. > > workspace.clientAdded.connect(function(client) { > client.minimized = false; > }); > > > Bernard, to test KWin scripts, type this in Konsole: > > qdbus org.kde.plasma-desktop /MainApplication showInteractiveKWinConsole > > Then an Editor/Output window appears. Paste the above 3-line script there, > and click "Execute". Then try to reproduce again. Tested and confirmed that workaround fixes the bug This also seems to work around the issue where opening new libreoffice program windows would open in the background/minimised. > Thomas might provide an improved and installable version. Fantastic news - thanks for the unbelievably quick response :) The behavior is deliberate (manage.cpp:~465 "// If a dialog is shown for minimized window, minimize it too") and likely intended to prevent the user from interruptions of minimized windows (the WM cannot decide whether this is spontanous or required) until the user moves focus to this window again. You will also notice that LOo does not unminimize nor (attempt) to gain focus if you open a *.ods (which does not require a conversion dialog) More interestingly, though the dialog is initially modal for the present window, it opens a new window with the csv (here at least), ie. the transiency and modality seems questionable in the first place. ----- My suggestion would thus be to rather "fix" the "libreoffice" script to either map/raise/activate the mainwindow when opening a new document? Something like if [ -e "$2" ]; then wmctrl -x -a libreoffice fi on the head of /usr/lib/libreoffice/program/soffice ? For general discussion on the topic of modal dialogs aligning to the mapping state of their leader, please see bug #339635 given that the window is marked as demands attention I consider this as the expected behavior. Thanks for the detailed replies folks, at the very least I have the option of implementing some of my own patches for now if required - Once again, thanks for the quick follow up and various detailed workarounds. I've implemented a kwin script for now. I've also arranged a donation to the KDE e.V. (to say thanks another way!) http://kde-look.org/content/show.php?content=167372 The script only applies to transient dialogs and unminimizes the main window as well to ensure context. Thomas Lübking, thanks for the script, but it not solve this issue fully. Maybe we can extend it via auto move focus to any new LibreOffice window created? Is there any hooks for this event in kwin? (In reply to Murz from comment #10) > Maybe we can extend it via auto move focus to any new LibreOffice window > created? To get an idea what you're talking about: do you rather encounter bug #340915 ? (being -likely- https://bugs.documentfoundation.org/show_bug.cgi?id=75471) The issue overthere is not about dialogs for minimized windows, but for libreoffice _actively_ denying to take the focus. Thomas Lübking, thanks for the link, I talking about https://bugs.kde.org/show_bug.cgi?id=340915 issue, so I will go into it :) Quite unsurprisingly, the three liner from comment 2 as well as the script http://kde-look.org/content/show.php?content=167372 won't work on Plasma 5, giving "Error: ReferenceError: Can't find variable: workspace at line 16" However, Libre Office's dialogs that do not get focus is really PITA even on Plasma 6 ,-) Can anyone present an updated version here? The script API didn't change (for KWin 5, no promises for 6 =) and the stock scripts "of course" access the workspace object. How did you install the script, does it show up in "kcmshell5 kwinscripts" and is it present in ~/.local/share/kwin/scripts/ ? Did you verify the warning is from the kwin_x11 process and you didn't perhaps install the script to plasmashell (the desktop) - what will of course not work? You are right, my mistake was to overlook the choice between "Plasma" and "KWin" that has to be made close to the upper right corner of editor's toolbar. It defaults to "Plasma", and hence the script failed. After choosing "KWin" it works on Plasma 5, too. |