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

support more wm states (keep above, below, etc) #773

Closed
totaam opened this issue Jan 3, 2015 · 25 comments
Closed

support more wm states (keep above, below, etc) #773

totaam opened this issue Jan 3, 2015 · 25 comments

Comments

@totaam
Copy link
Collaborator

totaam commented Jan 3, 2015

Issue migrated from trac ticket # 773

component: core | priority: major | resolution: fixed

2015-01-03 06:23:08: totaam created the issue


As part of the work to better support all the window manager hints, we should try to support more states - and sync them both ways, so that an application can request a window to be kept above others (or below or whatever) and that the user can do the same thing using the client side window manager and we will reflect that on the server side (which should then be taken into account when re-stacking windows, focus, etc)

Somewhat related to #765, #723, etc.

Links:

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2015

2015-01-03 06:24:30: totaam changed status from new to assigned

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2015

2015-01-03 06:24:30: totaam changed owner from antoine to totaam

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2015

2015-01-03 06:24:30: totaam edited the issue description

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2015

2015-01-03 09:05:10: totaam changed status from assigned to new

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2015

2015-01-03 09:05:10: totaam changed owner from totaam to afarr

@totaam
Copy link
Collaborator Author

totaam commented Jan 3, 2015

2015-01-03 09:05:10: totaam commented


Added:

  • "above", "below" and "sticky in r8356
  • "skip-taskbar" and "skip-pager" in r8358
  • misc

Those new states can be seen using xpra info.

Caveats:

  • support for those flags varies from OS to OS, and some window managers may implement those differently (ie: we need r8359 to fix window positioning after re-enabling window decorations on win32)
  • "skip-taskbar" only worked one-way when I tested it (cannot be disabled afterwards) - and it didn't work at all on win32 (though it may work if the flag is set before the window is first shown?)
  • we don't necessarily get notified when the action is taken client-side (so things end up out of sync with the server out of date), for example with openbox I never got the above/below window state changes

afarr: this is more FYI than anything else, though a bit more testing on OSX wouldn't hurt. As of r8368, the test application to use is "test window states". Useful client side debug flag: -d window.

@totaam
Copy link
Collaborator Author

totaam commented Jan 24, 2015

2015-01-24 02:17:29: afarr commented


Doing a quick test of the "test window states" buttons... it looks like the windows client is more problematical than the osx.

windows:
maximize works, unmaximize doesn't work, fullscreen works, unfullscreen doesn't work, decorate/undecorate works, keep above works, not above works (for the test_window, doesn't trigger fix for firefox window), keep below works for one or two toggles - but then it takes top level focus again, not below doesn't work at all, stick doesn't seem to do anything ( invalid _NET_WM_DESKTOP request: workspace=4294967295, number of desktops=1 maybe it needs a second display to test?), unstick doesn't seem to do anything, skip/not skip taskbar doesn't seem to do anything.

osx:
maximize works, unmaximize works, fullscreen works, unfullscreen works, decorate/undecorate work, keep above/ not above work, keep below/ not below work, stick/unstick doesn't work (again 2015-01-23 18:04:15,848 invalid _NET_WM_DESKTOP request: workspace=4294967295, number of desktops=1, will test again with dual monitor setup later), skip pager/not skip pager/skip taskbar/not skip taskbar - no sign of any effects.

@totaam
Copy link
Collaborator Author

totaam commented Jan 24, 2015

2015-01-24 05:35:17: totaam commented


OK, thanks for the _NET_WM_DESKTOP info, turns out to be a bug which also uncovered other bugs in this area, fixed in r8537 (will backport).
The workspace stuff is only supported on Linux AFAIK, Windows 10 will finally support virtual desktops but I very much doubt that GTK2 will ever support it... which means we will need pywin32 monkey patching to support it.

Anyway:

  • win32:
  • maximize works, unmaximize doesn't work: what do you mean? Does it stay maximized? I can unmaximize the window whether I maximized it via the button or via the window's top bar buttons.

  • fullscreen works, unfullscreen doesn't work: same question

  • decorate/undecorate works: good, quite a bit of effort went into making undecorated + maximize work on win32 (as GTK breaks it by default)

  • keep above works, not above works (for the test_window, doesn't trigger fix for firefox window): I don't understand this, why would this affect the firefox window in any way? (I assume the firefox window is another xpra forwarded window)

  • keep below works for one or two toggles - but then it takes top level focus again, not below doesn't work at all, stick doesn't seem to do anything: I don't think this works on win32 (GTK bug)

  • unstick doesn't seem to do anything: that's only relevant to multiple desktops (it keeps the window visible on all virtual desktops), and since win32 doesn't have any... it doesn't do anything.

  • skip/not skip taskbar doesn't seem to do anything: looks like a GTK bug, doesn't do anything on X11 either - meh, not sure it is worth the effort for this release (found a link which includes a workaround using pywin32: hide window from MS windows taskbar)

  • osx:

  • ... works!

  • stick/unstick doesn't work: someone would need to implement workspace support for OSX Lion and later (see OS X Mountain Lion: Work in multiple spaces)

  • skip pager/not skip pager/skip taskbar/not skip taskbar - no sign of any effects: probably the same as above, either a bug in GTK or just not implemented on OSX..

@totaam
Copy link
Collaborator Author

totaam commented Feb 18, 2015

2015-02-18 01:35:54: afarr commented


Well, it's been a while... and it looks like I neglected to list versions for above comment. So I went through it again.

Win32 0.15.0 8647 client, fedora20 0.15.0 r8661 server.

  • maximize/unmaximize works as expected.
  • fullscreen/unfullscreen no longer do anything (fullscreen button doesn't respond, so hard to really test unfullscreen properly, but it doesn't unmaximize after either using the maximize button or after using the maximize icon in top right of test_window_state window... unlike maximize, there's also no output with a -d window flag).
  • decorate/undecorate still work wonderfully.
  • keep above/not above work as expected.
  • keep below only seems to work to put the window below... after clicking on a couple of other overlapping windows then back to the test_window_states window, it jumps above when taking focus. (As an additional side note, after a few tries through, the keep below button stopped even placing the window below overlapping windows.

(Stopping the session to re-start and try to grab logs, I got the following traceback server-side, while using your beta server build. Might be a coincidence, but I only had two xterms and the test_window_states.py open when shutting down the server with a control-c:

2015-02-17 17:18:08,918 error trying to stop pulseaudio
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/xpra/server/server_base.py", line 329, in cleanup_pulseaudio
    self.pulseaudio_proc.terminate()
  File "/usr/lib64/python2.7/subprocess.py", line 1551, in terminate
    self.send_signal(signal.SIGTERM)
  File "/usr/lib64/python2.7/subprocess.py", line 1546, in send_signal
    os.kill(self.pid, sig)
OSError: [Errno 3] No such process
2015-02-17 17:18:09,431 xpra is terminating.

)

  • Tested again with -d window, attaching quick log from client-side, firing test_window_state.py from one of two xterms, move to overlap two local windows- a cmd window and a chrome window, click on keep below, click on one of the overlapping windows, click on the other overlapping window, then click on test_window_state window again... it takes top focus... and I end the session to grab the log. Which doesn't seem to show anything interesting.

  • Reconnecting to same server session with new client session, the keep below button is no longer working.

Summary: fullscreen button seems not to be working with above mentioned versions, and keep below is more like "put below". Not sure what might have happened with fullscreen button, but it sounds like you're saying that the keep below is probably a GTK bug?

@totaam
Copy link
Collaborator Author

totaam commented Feb 18, 2015

2015-02-18 09:24:13: antoine commented


fullscreen/unfullscreen no longer do anything
[[BR]]
Grrr. Works fine here on XP. Can you try with -d metadata,window. All the changes are metadata updates which now have their own debug flag (in later 0.15 builds)
[[BR]]
keep below only seems to work to put the window below..
[[BR]]
Did this used to work before with any of our builds? I've tried to debug this and we're not changing its state after calling set_below(True). Maybe win32 doesn't have a keep below state, just a push below action? (so not even a GTK bug, just the best approximation of the API call)
[[BR]]
Reconnecting to same server session with new client session, the keep below button is no longer working.
[[BR]]
You mean that it doesn't push it below, I think. That would be because it is already "below" as far as the server is concerned - so nothing is updated. Undoing the keep below should "fix" that.

@totaam
Copy link
Collaborator Author

totaam commented Feb 18, 2015

2015-02-18 09:48:06: antoine commented


Forgot to mention about the pulseaudio error: it is harmless, r8681 should now skip the scary looking warning.

@totaam
Copy link
Collaborator Author

totaam commented Feb 18, 2015

2015-02-18 23:23:11: afarr commented


Ok, ran it again with same client and server, -d metadata,window.

Started the session (2 xterms).
Ran test_window_states.py.
Clicked fullscreen.
Clicked unfullscreen.
Clicked fullscreen.
Clicked unfullscreen.
Closed session.

Attaching (relatively short) client-side log.

@totaam
Copy link
Collaborator Author

totaam commented Feb 18, 2015

2015-02-18 23:24:08: afarr uploaded file ticket773-keep_below_metadata-window.txt (32.5 KiB)

Win 32 client, fullscreen & unfullscreen buttons, -d metadata,window

@totaam
Copy link
Collaborator Author

totaam commented Feb 19, 2015

2015-02-19 02:51:51: antoine commented


As of r8686, we also forward changes to the "modal" state and handle the corresponding "_NET_WM_STATE" message.
Note: we still don't do anything with it client side, but hopefully one day we will. (GTK only supports global modal windows and we want per-application modal windows, see r3708)

@totaam
Copy link
Collaborator Author

totaam commented Feb 22, 2015

2015-02-22 16:13:48: antoine commented


I've just tested again with both Windows 7 and Windows XP, and I get the same thing with both, which is the same messages that you are seeing your log above (only -d metadata is needed):

2015-02-22 23:07:28,562 update_metadata({'fullscreen': True})
2015-02-22 23:07:28,566 set_metadata({'fullscreen': True})
2015-02-22 23:07:31,157 update_metadata({'fullscreen': False})
2015-02-22 23:07:31,157 set_metadata({'fullscreen': False})

And with every change, the window goes fullscreen / unfullscreen..
What am I doing wrong?
I've uploaded the exact build that I have used for testing: Xpra_Setup_0.15.0-[r8689](../commit/7a3c52eb27b5149f8a00ee7608d3e94cef63a33e).exe. (I've used the latest trunk for the server)

@totaam
Copy link
Collaborator Author

totaam commented Feb 24, 2015

2015-02-24 00:17:53: afarr commented


I'm not sure who is doing what wrong at this point.

Testing again with Xpra_Setup_0.15.0-[r8689](../commit/7a3c52eb27b5149f8a00ee7608d3e94cef63a33e) on windows 8.1 against a fedora 20 0.15.0 r8661 server, I managed to confuse myself. A lot.

  • At first, when I clicked the fullscreen button, the test_window_states.py window opens to fullscreen and outputs as expected:
2015-02-23 15:47:40,811 update_metadata({'fullscreen': True})
2015-02-23 15:47:40,811 set_metadata({'fullscreen': True})

... but when I clicked the unfullscreen button, the window didn't respond and I saw no output from the client.

  • Unable to unfullscreen, I grabbed the session with another machine, osx... and both buttons worked as expected with it... except that when unfullscreening, the window was still larger than the display and had to be manually resized.

  • A few iterations through this routine, I noticed that, if I put the test_window_states.py window on the left-most monitor (a nearly totally dysfunctional display used only for testing multi-display issues), then both fullscreen and unfullscreen worked as expected.

  • Then, perhaps simply to utterly mystify me... both buttons suddenly started working on the right-most monitor as well.


At this point I can no longer repro the issue, despite being able to do so an hour ago, and despite not having made any change to client or server version (it has been, in fact, the same server session all along).

On a hunch I even tried to uninstall the java-devel for #718... no effect.

I will try again tomorrow... and if I still can't repro, I suppose we'll call it fixed?

@totaam
Copy link
Collaborator Author

totaam commented Feb 24, 2015

2015-02-24 01:01:32: antoine commented


... but when I clicked the unfullscreen button, the window didn't respond and I saw no output from the client.
[[BR]]
It would be worth capturing xpra info | grep fullscreen at that point, maybe the server thinks that the window is not fullscreen, and so the request to unfullscreen it is simply ignored? Or something.

[[BR]]

Unable to unfullscreen, I grabbed the session with another machine, osx... and both buttons worked as expected with it... except that when unfullscreening, the window was still larger than the display and had to be manually resized.
[[BR]]
That would be because the application remembers its size before going fullscreen, we don't keep that information anywhere (either client side or server side). It's not very practical but applications are allowed to make windows bigger than the screen! So I don't think we should worry too much about this one, it's a corner case anyway.

[[BR]]

Then, perhaps simply to utterly mystify me... both buttons suddenly started working on the right-most monitor as well.
[[BR]]
!

[[BR]]

I will try again tomorrow... and if I still can't repro, I suppose we'll call it fixed?
[[BR]]
No rush to close this ticket, I think it's mostly done but there may be a race still present. Perhaps similar to #790, making us not update metadata when we should.

@totaam
Copy link
Collaborator Author

totaam commented Mar 6, 2015

2015-03-06 23:23:09: afarr commented


Quick update.

Had Max test again with that now fixed win32 client - everything seemed to work as expected. I'm suspecting that the missing pywin32 from our builds might've been the issue (?).

He did also mention that the osx keep above and keep below don't seem to be working (it looks like they had been previously).

@totaam
Copy link
Collaborator Author

totaam commented Mar 8, 2015

2015-03-08 06:45:42: antoine commented


Had Max test again with that now fixed win32 client - everything seemed to work as expected. I'm suspecting that the missing pywin32 from our builds might've been the issue (?).
[[BR]]
We show the version of pywin32 we bundle in various places (bug report tool, Version_info.exe).
I doubt that you were missing pywin32 completely, as things would not work well without it. Worth checking. The current version is 219.

[[BR]]

He did also mention that the osx keep above and keep below don't seem to be working (it looks like they had been previously).
[[BR]]
I doubt it, unless we somehow switched to a different GTK version on OSX.

Unless you can confirm that this has regressed from an earlier build, please close this ticket.

@totaam
Copy link
Collaborator Author

totaam commented Mar 9, 2015

2015-03-09 23:50:29: afarr changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Mar 9, 2015

2015-03-09 23:50:29: afarr set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Mar 9, 2015

2015-03-09 23:50:29: afarr commented


Double checking with a new osx client build, Max found keep above and keep below working as expected... so I'm closing this. While I can.

@totaam totaam closed this as completed Mar 9, 2015
@totaam
Copy link
Collaborator Author

totaam commented Mar 19, 2015

2015-03-19 15:02:23: totaam commented


r8802 now syncs more window attributes back with the server (for X11 clients only): we watch for changes to the window's _NET_WM_STATE, which has a lot more useful information than what we get from GTK, and send that back to the server.

@totaam
Copy link
Collaborator Author

totaam commented Mar 28, 2015

2015-03-28 08:36:23: antoine commented


Found one more problem related to this change and #790: we end up sending a configure packet with metadata for OR windows.. which is illegal and caused the warnings which made me add debug in r8852 + r8854.

Now, the state updates we sent aren't helpful for an OR window:

{'skip-taskbar': True, 'skip-pager': True}

And maybe we should skip those?

But we may encounter updates that are, so we need to handle this case anyway. r8855 does that.

@totaam
Copy link
Collaborator Author

totaam commented Mar 28, 2015

2015-03-28 08:37:42: antoine uploaded file OR-windows-skip-flags.patch (0.7 KiB)

the two flags we could skip - but which would then not be synchronized unless we add more code server-side.. (yuk)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant