Menu

#1720 On multiple monitor system, KDE windows/menus open on wrong monitor

KeePass_2.x
open
nobody
None
5
2022-12-22
2018-03-05
No

On a dual monitor system, KDE 5 desktop with Keepass2 on the right/secondary monitor, menus and dialog boxes appear on the left/primary monitor
Duplicated on Kubuntu 17.10 / Plasma ersion 5.12.2; and also on KDE Neon.
Selection_1518.png shows the file menu dropped down. Observed: The menu is hard against the right edge of the left monitor. (It's not that it is against the edge of the KP main window, I just made the screenshot as compact). Expected: in relative position to the KP window "File" pad.

With dialog boxes, it seems be inconsistent. With my quick tests, File>New, File>Open, Tools>Options appeared on the left (incorrect) monitor, but File>Import,Export, Tools>Plugins appear on the right (same as window) monitor. It may be more complicated than it appears.

If the primary monitor is changed to the right monitor, it appears to be ok even when the KP window is on the left/secondary monitor. At a guess, there's some bad assumption in window-positioning math!

This might be a .NET/Mono issue (GTK# on KDE?). I just experimented with a number of apps - ones I use regularly (Thunderbird, Firefox, Libreoffice for example) are all fine with the dual screens; with PlasticSCM which is a Mono app, it did the dialog-in-wrong-place thing. I tried one tiny .NET app which I'd written myself, it was OK.

1 Attachments

Discussion

  • Paul

    Paul - 2018-03-06

    It is likely to be a mono / NET issue as KeePass doesn't do any screen handling.
    https://sourceforge.net/p/keepass/discussion/329220/thread/fa1d0349/#a693

    cheers, Paul

     
  • Walter Nicholls

    Walter Nicholls - 2018-03-06

    Interesting discussion. I've cast my eyes over some source code now

    On the inconsistency. Help->About appears centred over the main window as it should (actually it's better than that if the main window straddles monitors), it has:

    this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent

    Whereas Tools>Options always centres on the left monitor:

    this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen

    I haven't gone further to see what behaviour is on Windows; or investigated whether the problem is that the window parent of the options dialog is null or something (which might explain why the wrong monitor/screen is found) All stuff I don't have time for.
    This only started annoying me personally yesterday, as until now I've only every had KP on the left monitor anyway. But then I encouraged my wife to start using KP, and she uses her computer differently (astonishing <g>) which makes it very annoying.</g>

    Menus will be a different problem, I think. It could well be a winforms issue. My little test program that was working fine (ie File menu drops under the File pad as expected), is GTK#, so I'd have to find or write a winforms program. They're both clearly using the same mono version though (literally the same assemblys in the GAC)

     
  • Walter Nicholls

    Walter Nicholls - 2018-03-06

    Just tried downloading SafePad - also winforms, same mono version. Menu appears where it should. All dialogs seem to use CenterParent and work.

    So far Keepass2 is the only application I have found (in recent memory at least) that has this broken menu positioning on my KDE desktop. (Ignore my comments about PlasticSCM: it doesn't have any menus, and it is GTK anyway).

     
  • Andrew Stinson

    Andrew Stinson - 2020-10-28

    I have tested this with a 2 monitor set up trying both monitors as the primary one and cannot recreate this fault. Using version 2.46 on Windows 10 the program seems to consistently open windows on the correct monitor no matter where the program window is positioned.

    One note however, my two montors are stacked on top of each other so this could potentially explain why I am not getting results since it seems you have tested with side by side monitors and not stacked.

     
  • Emir

    Emir - 2022-12-21

    Hi,
    I have similar issue on keepass 2.42.1 on win10.

    When

    1. I close Keepass in multi monitor setup (laptop plus at least another monitor connected via a docking station) on one of the additional monitors AND
    2. re-open Keepass without this/those monitor attached
    3. THEN Keepass opens outside the visible area.

    As it seems Keepass saves the last position and re-open no matter if the position is still feasible.
    This is nasty because you cannot even move the Keepass window e.g with WIN+ARROW-LEFT to the visible area. I have found no alternative to attaching a monitor again.

     

Log in to post a comment.

MongoDB Logo MongoDB