view: adjust position according to declared top left corner#365
Open
joggee-fr wants to merge 2 commits intocage-kiosk:masterfrom
Open
view: adjust position according to declared top left corner#365joggee-fr wants to merge 2 commits intocage-kiosk:masterfrom
joggee-fr wants to merge 2 commits intocage-kiosk:masterfrom
Conversation
emersion
reviewed
Oct 15, 2024
Comment on lines
+67
to
+72
| struct wlr_box view_box; | ||
| view->impl->get_geometry(view, &view_box); | ||
|
|
||
| // Do not forget to adjust position according to top left corner declared in view geometry | ||
| view->lx = layout_box->x - view_box.x; | ||
| view->ly = layout_box->y - view_box.y; |
Member
There was a problem hiding this comment.
Hm, I'm not sure this is the correct spot to read the window geometry. The window geometry is likely to change when the client redraws in the maximized state. This function runs before though, when we send the event to ask the client to redraw itself maximized.
Collaborator
Author
There was a problem hiding this comment.
@emersion, I understand the client may adjust geometry using xdg_surface::set_window_geometry() before calling (again) wl_surface::commit(). wlroots then calls the handler for map event and in Cage view_map(), view_position() and finally view_maximize() or view_center() where the new geometry can be accessed.
The XDG surface geometry includes an (x,y) coordinate indicating the top left corner of the window. Use this information to correctly set the view position.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The XDG surface geometry includes an (x,y) coordinate indicating the top left corner of the window. Use this information to correctly set the view position.
Split from PR #278, it should fix issue #254.