Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Moving a maximized window to a smaller monitor via WinKey+Shift+LeftArrow does not fit it on destination #2643

Open
totaam opened this issue Mar 13, 2020 · 15 comments
Labels
bug Something isn't working client geometry win32 MS Windows OS
Milestone

Comments

@totaam
Copy link
Collaborator

totaam commented Mar 13, 2020

2020-03-13 14:55:58: stdedos created the issue

Moving maximized LibreOffice to the adjacent big monitor (via WinKey+Shift+LeftArrow) does not fit the screen with the maximized window.

Window "pretends" to be maximized, and left in a non-standard place in the new monitor.

You need to manually window it and then maximize it again.

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2020

I assume that the monitors have different geometries?

What are they? (the client output, ideally with -d geometry,screen would do)

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2020

2020-03-13 15:09:06: stdedos commented

Client monitors at #2642 attachment, I'll try to hack your client output now.

No way to do -d geometry,screen that on the fly, right?

@totaam
Copy link
Collaborator Author

totaam commented Mar 13, 2020

2020-03-13 15:27:15: stdedos commented


"Xpra-Python3-x86_64_4.0-[r25603](../commit/772e6a7edbcdfd1b09b16a5c0863669aa8286e56)\xpra_cmd" attach ssh://user@ip/2 --ssh="plink -ssh -agent" --modal-windows=no -d geomentry,screen

2020-03-13 17:23:04,156 SetProcessDPIAware: <_FuncPtr object at 0x0000000003f8bad0>()=1
2020-03-13 17:23:04,157 SetProcessDPIAwareness: <_FuncPtr object at 0x0000000003f8bc70>(1)=0
2020-03-13 17:23:04,718 Xpra GTK3 client version 4.0-[r25603](../commit/772e6a7edbcdfd1b09b16a5c0863669aa8286e56) 64-bit
2020-03-13 17:23:04,720  running on Microsoft Windows 10
2020-03-13 17:23:04,788 Warning: failed to import opencv:
2020-03-13 17:23:04,788  No module named 'cv2'
2020-03-13 17:23:04,788  webcam forwarding is disabled
2020-03-13 17:23:05,404 GStreamer version 1.16.2 for Python 3.8.2 64-bit
2020-03-13 17:23:05,622 keyboard layout code 0x409
2020-03-13 17:23:05,623 identified as 'United States - English' : us
2020-03-13 17:23:05,743 OpenGL_accelerate module loaded
2020-03-13 17:23:05,781 Using accelerated ArrayDatatype
2020-03-13 17:23:06,307 Warning: vendor 'Intel' is greylisted,
2020-03-13 17:23:06,307  you may want to turn off OpenGL if you encounter bugs
2020-03-13 17:23:06,319 OpenGL enabled with Intel(R) HD Graphics 4000
2020-03-13 17:23:06,324 get_vrefresh()=40
2020-03-13 17:23:06,542  keyboard settings: layout=us
2020-03-13 17:23:06,545 get_workareas() GetMonitorInfo(5112917)={'Work': (0, 0, 1600, 860), 'Monitor': (0, 0, 1600, 900), 'Flags': 1, 'Device': '\\\\.\\DISPLAY1'}
2020-03-13 17:23:06,545 get_workareas()=[(0, 0, 1600, 860)]
2020-03-13 17:23:06,547  monitor 0: ['(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174]
2020-03-13 17:23:06,548 get_workarea() absolute total monitor area: (0, 0, 1600, 900)
2020-03-13 17:23:06,549  total monitor dimensions: (1600, 900)
2020-03-13 17:23:06,549  workarea=(0, 0, 1600, 860)
2020-03-13 17:23:06,550  screen: ('3\\WinSta0\\Default', 1600, 900, 423, 238, [('(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174, 0, 0, 1600, 860)], 0, 0, 1600, 860)
2020-03-13 17:23:06,551 get_workareas() GetMonitorInfo(5112917)={'Work': (0, 0, 1600, 860), 'Monitor': (0, 0, 1600, 900), 'Flags': 1, 'Device': '\\\\.\\DISPLAY1'}
2020-03-13 17:23:06,551 get_workareas()=[(0, 0, 1600, 860)]
2020-03-13 17:23:06,552  monitor 0: ['(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174]
2020-03-13 17:23:06,555 get_workarea() absolute total monitor area: (0, 0, 1600, 900)
2020-03-13 17:23:06,556  total monitor dimensions: (1600, 900)
2020-03-13 17:23:06,557  workarea=(0, 0, 1600, 860)
2020-03-13 17:23:06,557  screen: ('3\\WinSta0\\Default', 1600, 900, 423, 238, [('(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174, 0, 0, 1600, 860)], 0, 0, 1600, 860)
2020-03-13 17:23:06,558 get_screen_settings() sizes=[('3\\WinSta0\\Default', 1600, 900, 423, 238, [('(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174, 0, 0, 1600, 860)], 0, 0, 1600, 860)], 1 desktops: []
2020-03-13 17:23:06,559 get_screen_settings() xdpi=96, ydpi=96
2020-03-13 17:23:06,559 get_screen_settings() scaled: xdpi=96, ydpi=96
2020-03-13 17:23:06,560 get_workareas() GetMonitorInfo(5112917)={'Work': (0, 0, 1600, 860), 'Monitor': (0, 0, 1600, 900), 'Flags': 1, 'Device': '\\\\.\\DISPLAY1'}
2020-03-13 17:23:06,560 get_workareas()=[(0, 0, 1600, 860)]
2020-03-13 17:23:06,561  monitor 0: ['(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174]
2020-03-13 17:23:06,562 get_workarea() absolute total monitor area: (0, 0, 1600, 900)
2020-03-13 17:23:06,562  total monitor dimensions: (1600, 900)
2020-03-13 17:23:06,563  workarea=(0, 0, 1600, 860)
2020-03-13 17:23:06,568  screen: ('3\\WinSta0\\Default', 1600, 900, 423, 238, [('(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174, 0, 0, 1600, 860)], 0, 0, 1600, 860)
2020-03-13 17:23:06,569  desktop size is 1600x900 with 1 screen:
2020-03-13 17:23:06,570   Default (423x238 mm - DPI: 96x96) workarea: 1600x860
2020-03-13 17:23:06,571     (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 131x131)
2020-03-13 17:23:06,575 get_icc_info() intents={1: 'relative-colorimetric', 2: 'saturation', 3: 'absolute-colorimetric'}
2020-03-13 17:23:06,583 get_icc_info() display_profile=<PIL.ImageCms.ImageCmsProfile object at 0x00000000075d37c0>
2020-03-13 17:23:06,584 <module 'PIL.ImageCms' from 'C:\\Users\\user.win\\Documents\\xpra-clients\\Xpra-Python3-x86_64_4.0-[r25603](../commit/772e6a7edbcdfd1b09b16a5c0863669aa8286e56)\\lib\\PIL\\ImageCms.pyc'> lacks getData
2020-03-13 17:23:06,585 xdpi=96, ydpi=96
2020-03-13 17:23:06,586 get_dpi_caps()={'x': 96, 'y': 96, '': 96}
2020-03-13 17:23:06,587 get_vrefresh()=40
2020-03-13 17:23:10,248 server desktop size=(1600, 900)
2020-03-13 17:23:10,250 server actual desktop size=(1600, 900)
2020-03-13 17:23:10,251 server has randr: True
2020-03-13 17:23:10,254 enabled remote logging
2020-03-13 17:23:10,256 Xpra GTK3 X11 server version 3.0.7-25609 64-bit
2020-03-13 17:23:10,257  running on Linux Ubuntu 16.04 xenial
2020-03-13 17:23:10,259 may_adjust_scaling() server_is_desktop=False, desktop_fullscreen=False
2020-03-13 17:23:10,260 validating server_max_desktop_size=(5760, 2560) vs root size=(1600, 900)
2020-03-13 17:23:10,261 maximum packet size set to 104861696
2020-03-13 17:23:10,265 Attached to ip:22
2020-03-13 17:23:10,267  (press Control-C to detach)


(xpra_cmd:12228): Pango-WARNING **: 17:23:11.479: couldn't load font "Bitstream Vera Sans Not-Rotated 14.662109375", falling back to "Sans Not-Rotated 14.662109375", expect ugly output.
2020-03-13 17:23:12,513 UI thread is now blocked
2020-03-13 17:23:12,533 UI thread is running again, resuming
2020-03-13 17:23:15,516 UI thread is now blocked
2020-03-13 17:23:16,588 screen_size_changed((<__gi__.GdkWin32Screen object at 0x0000000008d2b600 (GdkWin32Screen at 0x00000000039b5a20)>,)) timer=None
2020-03-13 17:23:16,702 Warning: static gravity is not handled
2020-03-13 17:23:16,748 UI thread is running again, resuming
2020-03-13 17:23:17,693 get_workareas() GetMonitorInfo(129633287)={'Work': (0, 0, 1600, 860), 'Monitor': (0, 0, 1600, 900), 'Flags': 1, 'Device': '\\\\.\\DISPLAY1'}
2020-03-13 17:23:17,761 get_workareas() GetMonitorInfo(5178453)={'Work': (1600, -181, 3520, 859), 'Monitor': (1600, -181, 3520, 899), 'Flags': 0, 'Device': '\\\\.\\DISPLAY2'}
2020-03-13 17:23:17,782 get_workareas()=[(0, 0, 1600, 860), (0, 0, 1920, 1040)]
2020-03-13 17:23:17,784  monitor 0: ['(Standard monitor types) Generic PnP Monitor', 0, 181, 1600, 900, 309, 174]
2020-03-13 17:23:17,785  monitor 1: ['(Standard monitor types) C32JG5x', 1600, 0, 1920, 1080, 697, 392]
2020-03-13 17:23:17,788 get_workarea() absolute total monitor area: (0, -181, 3520, 900)
2020-03-13 17:23:17,794  total monitor dimensions: (3520, 1081)
2020-03-13 17:23:17,796  workarea=(0, 0, 3520, 1041)
2020-03-13 17:23:17,798  screen: ('3\\WinSta0\\Default', 3520, 1081, 931, 286, [('(Standard monitor types) Generic PnP Monitor', 0, 181, 1600, 900, 309, 174, 0, 0, 1600, 860), ('(Standard monitor types) C32JG5x', 1600, 0, 1920, 1080, 697, 392, 0, 0, 1920, 1040)], 0, 0, 3520, 1041)
2020-03-13 17:23:17,800 get_workareas() GetMonitorInfo(129633287)={'Work': (0, 0, 1600, 860), 'Monitor': (0, 0, 1600, 900), 'Flags': 1, 'Device': '\\\\.\\DISPLAY1'}
2020-03-13 17:23:17,802 get_workareas() GetMonitorInfo(5178453)={'Work': (1600, -181, 3520, 859), 'Monitor': (1600, -181, 3520, 899), 'Flags': 0, 'Device': '\\\\.\\DISPLAY2'}
2020-03-13 17:23:17,803 get_workareas()=[(0, 0, 1600, 860), (0, 0, 1920, 1040)]
2020-03-13 17:23:17,807  monitor 0: ['(Standard monitor types) Generic PnP Monitor', 0, 181, 1600, 900, 309, 174]
2020-03-13 17:23:17,808  monitor 1: ['(Standard monitor types) C32JG5x', 1600, 0, 1920, 1080, 697, 392]
2020-03-13 17:23:17,810 get_workarea() absolute total monitor area: (0, -181, 3520, 900)
2020-03-13 17:23:17,811  total monitor dimensions: (3520, 1081)
2020-03-13 17:23:17,812  workarea=(0, 0, 3520, 1041)
2020-03-13 17:23:17,813  screen: ('3\\WinSta0\\Default', 3520, 1081, 931, 286, [('(Standard monitor types) Generic PnP Monitor', 0, 181, 1600, 900, 309, 174, 0, 0, 1600, 860), ('(Standard monitor types) C32JG5x', 1600, 0, 1920, 1080, 697, 392, 0, 0, 1920, 1040)], 0, 0, 3520, 1041)
2020-03-13 17:23:17,818 get_screen_settings() sizes=[('3\\WinSta0\\Default', 3520, 1081, 931, 286, [('(Standard monitor types) Generic PnP Monitor', 0, 181, 1600, 900, 309, 174, 0, 0, 1600, 860), ('(Standard monitor types) C32JG5x', 1600, 0, 1920, 1080, 697, 392, 0, 0, 1920, 1040)], 0, 0, 3520, 1041)], 1 desktops: []
2020-03-13 17:23:17,821 get_screen_settings() xdpi=96, ydpi=96
2020-03-13 17:23:17,823 get_screen_settings() scaled: xdpi=96, ydpi=96
2020-03-13 17:23:17,824 update_screen_size()     new settings=(3520, 1081, [('3\\WinSta0\\Default', 3520, 1081, 931, 286, [('(Standard monitor types) Generic PnP Monitor', 0, 181, 1600, 900, 309, 174, 0, 0, 1600, 860), ('(Standard monitor types) C32JG5x', 1600, 0, 1920, 1080, 697, 392, 0, 0, 1920, 1040)], 0, 0, 3520, 1041)], 1, [], 3520, 1081, 96, 96)
2020-03-13 17:23:17,826 update_screen_size() current settings=(1600, 900, [('3\\WinSta0\\Default', 1600, 900, 423, 238, [('(Standard monitor types) Generic PnP Monitor', 0, 0, 1600, 900, 309, 174, 0, 0, 1600, 860)], 0, 0, 1600, 860)], 1, [], 1600, 900, 96, 96)
2020-03-13 17:23:17,831 sending updated screen size to server: 3520x1081 with 1 screens
2020-03-13 17:23:17,833   Default (931x286 mm - DPI: 96x96) workarea: 3520x1041
2020-03-13 17:23:17,835     (Standard monitor types) Generic PnP Monitor 1600x900 at 0x181 (309x174 mm - DPI: 131x131) workarea: 1600x860
2020-03-13 17:23:17,836     (Standard monitor types) C32JG5x 1920x1080 at 1600x0 (697x392 mm - DPI: 69x69) workarea: 1920x1040
2020-03-13 17:23:17,842 maximum packet size set to 104861696
2020-03-13 17:23:17,845 do_process_screen_size_change() MONITOR_CHANGE_REINIT=0, REINIT_WINDOWS=True
2020-03-13 17:23:17,847 screen size change: will reinit the windows
2020-03-13 17:23:18,294 server has resized the desktop to: 3520x1081 (max 5760x2560)
2020-03-13 17:23:18,342 may_adjust_scaling() server_is_desktop=False, desktop_fullscreen=False

2020-03-13 17:23:47,361 got signal SIGINT
2020-03-13 17:23:47,363 exiting

@totaam
Copy link
Collaborator Author

totaam commented Mar 14, 2020

So the monitor geometry started as:

desktop size is 1600x900 with 1 screen:
  Default (423x238 mm - DPI: 96x96) workarea: 1600x860
    (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 131x131)

But then you plugged in the second one?

sending updated screen size to server: 3520x1081 with 1 screens
  Default (931x286 mm - DPI: 96x96) workarea: 3520x1041
    (Standard monitor types) Generic PnP Monitor 1600x900 at 0x181 (309x174 mm - DPI: 131x131) workarea: 1600x860
    (Standard monitor types) C32JG5x 1920x1080 at 1600x0 (697x392 mm - DPI: 69x69) workarea: 1920x1040

I don't see the libreoffice window geometry, or the move.

@totaam
Copy link
Collaborator Author

totaam commented Mar 14, 2020

2020-03-14 18:11:52: stdedos commented


Replying to [comment:4 Antoine Martin]:

So the monitor geometry started as:

desktop size is 1600x900 with 1 screen:
  Default (423x238 mm - DPI: 96x96) workarea: 1600x860
    (Standard monitor types) Generic PnP Monitor (309x174 mm - DPI: 131x131)

But then you plugged in the second one?

sending updated screen size to server: 3520x1081 with 1 screens
  Default (931x286 mm - DPI: 96x96) workarea: 3520x1041
    (Standard monitor types) Generic PnP Monitor 1600x900 at 0x181 (309x174 mm - DPI: 131x131) workarea: 1600x860
    (Standard monitor types) C32JG5x 1920x1080 at 1600x0 (697x392 mm - DPI: 69x69) workarea: 1920x1040

Yeah, I was about to replicate it for the logs, and I just remembered I was missing something :-p

I don't see the libreoffice window geometry, or the move.

Yeah, I was having the same impression too (but I try not to get too involved with the logs).
I'll try again soon

@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2020

2020-03-19 11:29:24: stdedos uploaded file xpra-2643.log (41.2 KiB)

@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2020

2020-03-19 11:29:53: stdedos commented


Scaling down works, scaling up not. See attachment !^!^!^

@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2020

Scaling down works, scaling up not. See attachment ^^^

What does this ticket have to do with scaling?
What am I looking for in this log?

What I have found:

  • a logging error fixed in r25684
  • an application is creating a 1x1 window: 2020-03-19 13:24:24,141 process_new_common: wid=10, OR=True, geometry([-99, -99, 1, 1])=(-98, -98, 1, 1) / (1, 1) (those are usually used for events only and should not be forwarded, but it looks like they're using the wrong window type... so we do)

@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2020

2020-03-19 14:49:06: stdedos commented


Scaling down works, scaling up not. See attachment ^^^
What does this ticket have to do with scaling?

Scaling == When moving a maximized window from one monitor to a monitor with different geometry, the window "re-adjusts" to be properly maximized on the new monitor.
Since I have never used the term scaling extensively in my computer-language (with the exception of xpras desktop-scaling which is like zooming, and image scaling), I assigned the phrase "the window is scaling" to the above behavior. I don't know if there is a more proper term for that.

What am I looking for in this log?

A window that was moved from a 1600x900 monitor to the right 1920x1080 monitor (in automated fashion) while maximized.

@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2020

When moving a maximized window from one monitor to a monitor with different geometry, the window "re-adjusts" to be properly maximized on the new monitor
I don't know if there is a more proper term for that.

Let's call it "re-adjusts".

@totaam
Copy link
Collaborator Author

totaam commented Mar 20, 2020

2020-03-20 07:26:25: stdedos commented


Windows monitor geometry also here [/attachment/ticket/2658/xpra-geometry-ApplicationFrameHost_2020-03-20_09-17-15.png]

@totaam
Copy link
Collaborator Author

totaam commented Dec 1, 2020

2020-12-01 13:21:29: stdedos commented


"Re-adjust" behavior works much more solidly in py2-3.0.12

@totaam totaam added the v3.0.x label Jan 22, 2021
@totaam totaam added bug Something isn't working client geometry win32 MS Windows OS and removed v3.0.x labels Jan 26, 2021
@totaam totaam added this to the 4.2 milestone Jan 26, 2021
@totaam
Copy link
Collaborator Author

totaam commented May 18, 2021

@stdedos: can you try doing the same thing with any "regular" window you want from the native xpra toolbox?
My guess is that the problem is the same as #3122 - something in GTK is preventing this from working.

@stdedos
Copy link
Collaborator

stdedos commented May 18, 2021

I'll check this tomorrow - hopefully there is a window that maximizes 😀

@stdedos
Copy link
Collaborator

stdedos commented May 19, 2021

Window States window does the job.

... and, it exhibits the same behavior as other windows.
The only mitigating fact is that, when un-maximized, its entirety is on the new monitor; a subsequent maximization solves the issue. "Other" windows end up too big and/or not clearly placed on the next monitor - which requires manual intervention to associate them where they need to be.
Other fact is that it does not exhibit #3122; click-drag-maximize works fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working client geometry win32 MS Windows OS
Projects
None yet
Development

No branches or pull requests

2 participants