#2141 closed defect (fixed)
Small improvements to window position on client
Reported by: | Mark Harkin | Owned by: | Mark Harkin |
---|---|---|---|
Priority: | minor | Milestone: | 2.5 |
Component: | client | Version: | 2.4.x |
Keywords: | Cc: |
Description
These are less PR's and more pointers for fixing the underlying issues.
Java AWT is very old and assumes 1 screen per 1 monitor. However, Xpra uses 1 screen across multiple monitors, while this is valid it doesn't play nice with Java AWT Toolkit which centers windows on the screen and not the monitors. The case I have fixed this for is a window centering across 2 side-by-side monitors. The window is repositioned to the center of the 1st monitor when centered across the screen (with a magic number margin of error of 10px). Maybe this could be implemented better, only for java awt windows and with an environment variable flag to have it off by default?
https://github.com/mjharkin/Xpra/commit/e583d6c858f1e5bf3c20d2763a028b65247a7538
When I had a frameless java window that could be moved by dragging it, it was jumping uncontrollably (#1941). Windows would sometimes jump with the title bar above the screen out of view. I don't think this is/should be allowed by any OS. I haven't yet considered a monitor above yet but my hack to fix this was:
https://github.com/mjharkin/Xpra/commit/b4d71a34d6a1ce428552f7ee16200c0a59d9b705
Attachments (2)
Change History (10)
Changed 2 years ago by
Attachment: | MainWindow.java added |
---|
comment:1 Changed 2 years ago by
Owner: | changed from Antoine Martin to Mark Harkin |
---|
Java clearly ignores the xinerama data (#496), just like it does with DPI, so we need to fixup the window position instead.
r21614 merges your patch after making some small changes:
- add environment variable to disable this behaviour:
XPRA_AWT_RECENTER
- refactor the existing AWT window detection code, and only apply the workaround to AWT windows
- move position adjustment to a method we can re-use from both
setup_window
andadjusted_position
- be more defensive and don't assume screens and monitors are always present, only recenter if there is more than one monitor
@mjharkin: does that work for you?
I've used the example Java class above and got it to center on the first monitor.
comment:2 Changed 2 years ago by
As for the second issue, r21616 prevents that, but it is only enabled by default on macos and mswindows for now. Many X11 window managers will let you move windows as long as you can see an edge of it.
Changed 2 years ago by
Attachment: | firefox_dropdown.png added |
---|
comment:3 Changed 2 years ago by
That's great thanks, r21614 and r21616 work as expected.
2 more changes I've made (and I think the only remaining changes for the python client are):
1: an issue with the Options drop down in Firefox while maximized is causing it to be pushed to the next screen. Attached screenshot of the menu when not maximized shows it overshooting the window. Since this is in the transparent area I just hacked the code to allow monitor width +1
https://github.com/mjharkin/Xpra/commit/0c84f8153c76ca122399273673ec46de94bd7807
Not sure how or if you want to handle this one.
2: small updates to the tray menu. Allowing SHOW_CLOSE as env variable and reducing icon size in the start submenu to same as the rest of the tray menu.
https://github.com/mjharkin/Xpra/commit/cfda409210ba945070b048eab65c1c5634082fb3
comment:4 Changed 2 years ago by
- the drop down in Firefox is fixed more properly in trunk with r21631 (this was caused by r13669 + r13670 for #1284) - I'll try to come up with something more suitable for backporting to v2.4.x
- making the "close" menu entry an option was merged in r21632.
- as for the icon size, the more correct fix is in r21636.
@mjharkin: can I close this ticket?
comment:5 Changed 2 years ago by
Resolution: | → fixed |
---|---|
Status: | new → closed |
Yes, all 3 fixes are now working as expected. Thanks.
comment:6 Changed 2 years ago by
Resolution: | fixed |
---|---|
Status: | closed → reopened |
Originally tested r21616 with the env variable set, but should default correctly so reopening.
gtk_client_window_base.py
WINDOW_OVERFLOW_TOP = envbool("XPRA_WINDOW_OVERFLOW_TOP", not (WIN32 and OSX))
I think this should be:
WINDOW_OVERFLOW_TOP = envbool("XPRA_WINDOW_OVERFLOW_TOP", not (WIN32 or OSX))
comment:7 Changed 2 years ago by
Resolution: | → fixed |
---|---|
Status: | reopened → closed |
oops, sorry about that.
r21785 enables it everywhere by default since most Linux DEs seem to no longer allow windows to be moved using the frame.
comment:8 Changed 6 weeks ago by
this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/2141
awt test case based on the example from #1975