-
Notifications
You must be signed in to change notification settings - Fork 343
Add support for xwayland_minimize actions #2264
Conversation
|
||
if (xsurface == NULL) { | ||
return; | ||
} else if (detail == ICCCM_ICONIC_STATE) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the relationship between ICCCM_ICONIC_STATE
and NET_WM_STATE_HIDDEN
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if a window is minimized it's both the NET_WM_STATE is hidden the WM_STATE is iconic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, so why do we need to handle ICCCM_ICONIC_STATE
changes?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bump
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the way minimize is being set - through WM_STATE which is iconic state - i3 does the same, net_wm_state_hidden mean window is not visible, iconic state means minimized, see here: https://specifications.freedesktop.org/wm-spec/wm-spec-latest.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure what your above statement means code-wise,
or does it just mean 'resolved'.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are two code-paths in this PR:
- Client wants to become minimized. It sends
NET_WM_STATE_HIDDEN
, and if I understand correctly, it can alternatively sendICCCM_ICONIC_STATE
. In this case, wlroots should (1) not minimize the window and (2) emit arequest_minimize
event. (1) is important because we need to let the compositor handle the request. Maybe the compositor can't minimize windows. Maybe the compositor wants to do something else when a client requests to be minimized. The compositor must stay in control. wlroots shouldn't do anything behind the compositor's back. - A compositor decides to minimize a window. This can be in response to a
request_minimize
event, or this can be because of something else (e.g. the user clicked "minimize" in a compositor menubar). The compositor will callwlr_xwayland_surface_set_minimized
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@damianatorrpm this discussion needs to be resolved - this is the main blocker for this patch.
wlroots isn't a window manager in its own right, its a toolkit for window managers. We just help information flow smoothly from client to compositor implementation, and the compositor implementation calls the shots. So, instead of having wlroots' Xwayland layer handle the minimize request, we need to add a new event which the compositor can register for, which is emitted when the window requests to be minimized. Then, the compositor can decide what to do - for example, calling wlr_xwayland_surface_set_minimized
themselves.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been changed, see the updated PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has been resolved, see updated PR
Thanks for your PR! Please make sure tabs are used for indentation. Some lines use spaces in this patch. |
I think all is resolved |
Strange how do I remove the whitespace than, I edit using gedit and it's set to tabs and show the "trailing whitespace" as tabs |
It is a tab, it's just extra after the end of the line. For example, you have code:
After the |
Yup. To be more explicit: const bool change = surface->minimized != minimized; ← this is a tab |
@TheAvidDev @emersion ah, now I see it, of course trailing like in a trailer... |
i3/i3@136b3e3 |
@@ -1164,6 +1176,12 @@ static void xwm_handle_net_wm_state_message(struct wlr_xwm *xwm, | |||
|
|||
wlr_signal_emit_safe(&xsurface->events.request_maximize, xsurface); | |||
} | |||
|
|||
if (minimized != xsurface->minimized) { | |||
xsurface->saved_width = xsurface->width; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only do this if the surface is minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be more specific in your comments.
Do what emit signals? Safe size?
The handling is exactly the same as for maximized in this function.
I suppose the below is what you think is right so I changed it to that:
if (minimized && minimized != xsurface->minimized) {
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we want to emit the signal even if the client requests to not be minimized.
Please have a look at the similar block of code above for maximized. We only set saved_width
and saved_height
if the surface becomes maximized. We should do the same here, only update the saved size if the surface wants to become minimized.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you look into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see how this is wrong, maybe you suggest a proper way?
Github has the ability to suggest changes.
It is handled the way fullscreen is.
@@ -1215,6 +1233,19 @@ static void xwm_handle_client_message(struct wlr_xwm *xwm, | |||
xwm_handle_wm_protocols_message(xwm, ev); | |||
} else if (ev->type == xwm->atoms[NET_ACTIVE_WINDOW]) { | |||
xwm_handle_net_active_window_message(xwm, ev); | |||
} else if (ev->type == xwm->atoms[WM_CHANGE_STATE]) { | |||
struct wlr_xwayland_surface *xsurface = lookup_surface(xwm, ev->window); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we extract all of this into a xwm_handle_wm_change_state_message
function?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you look into this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See comments
Bump. |
Please bump every week. We don't have enough time to reply to 2-day bumps for patches that aren't critical bugfixes. |
It's a bug fix see description. |
No, it's a new feature. |
Cool stuff. Once you replied to the in-conversations let me know. |
@damianatorrpm you need to be more polite to the people kind enough to review your patch. There are multiple open problems in the discussion that you need to address; bumping the thread before then is not helpful. Also, general review comment: when you have everything squared away, please rebase these commits into a single commit. |
4b3e8b1
to
3f20820
Compare
as required by chrome/steam csd or games PR style fixes Trailinig whitespaces and a space 2 more excess tabs suggeste fixes rev suggestions typo type refact typo
@ddevault The commits are in a single commit. When contributors send pull request, reviewers should have the tactfulness to read related and linked documentation, to have an understanding technically what it is about, instead of arguing on documented properties, which shows a 'less than interested' attitude. I suggest and hope we move forward any misunderstanding.
All things mentioned have been addressed to the best of my knowledge and the discussions 'resolved'. |
You have a bad attitude, and it's not worth further damaging our reviewer's mental health to deal with you. It is not us that lack tact in this exchange. |
If someone else wants to adopt this work and bring it to us with a better attitude, we'd be interested in reviewing it again later. |
as required by chrome/steam csd or games:
Fixes #2251
In the PR there is also a fix for a forgotten break statement
Minimize functionality tested with wayfire