-
Notifications
You must be signed in to change notification settings - Fork 158
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
ssd: allow ssd to be smaller than minimal size #1959
Conversation
With 2603dbf labwc refused to update ssd geometry when its geometry is smaller than minimal size in order to prevent passing negative values in wlr_scene_rect_set_size(), but it made ssd for small windows like workrave ugly. So this commit fixes the negative values for each call to wlr_scene_rect_set_size() individually rather than just early-return in ssd_update_geometry(). Co-Authored-By: Consolatis <35009135 [email protected]>
int width = view->current.width; | ||
int width = MAX(view->current.width, LAB_MIN_VIEW_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.
Should we limit the size of extents?
I found today that xterm
can be resized to 1x1, and that this change makes cursor position and view geometry out of sync while resizing like the video below:
2024-07-05.02-44-56.mp4
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.
Nice catch! I only tested with the test client which doesn't allow resizing.
Limiting the extents seems correct to me but something seems off with the offset when then enlarging the surface again.
I'll look into it later.
By the way, I am looking into an alternative approach that would just scale down the SSD buttons as the view gets smaller. I think I would personally prefer that behavior if it's not too hard to implement. |
That would be an option as well. Might get pretty tricky with the icons though as they are scaled and positioned within the button to match the hardcoded sizes. Additionally, those (and also the hover effects) are created once when loading the theme and then shared across all SSD button instances. @heroin-moose is currently working on configurable button width via theme settings but that doesn't have the same issue as this one in regards to possibly having separate sizes per SSD instance. |
? rc.theme->window_active_border_color | ||
: rc.theme->window_inactive_border_color); | ||
} | ||
wlr_scene_rect_set_size(ssd->view_background, LAB_MIN_VIEW_WIDTH, current.height); |
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.
Maybe we should resize the background to the size of padding area rather than the whole view size, as the surface may be translucent.
Set to draft until discussion in #1964 is concluded. |
Superseded by #2116 |
With 2603dbf labwc refused to update ssd geometry when its geometry is smaller than minimal size in order to prevent passing negative values in wlr_scene_rect_set_size(), but it made ssd for small windows like workrave ugly. So this commit fixes the negative values for each call to wlr_scene_rect_set_size() individually rather than just early-return in ssd_update_geometry().
Follow-up from