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

ssd: allow ssd to be smaller than minimal size #1959

Closed
wants to merge 1 commit into from

Conversation

Consolatis
Copy link
Member

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

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);
Copy link
Contributor

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

Copy link
Member Author

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.

@jlindgren90
Copy link
Contributor

This doesn't seem to work as desired when the view starts at less than the minimum size, for example xterm -geom 1x1:

Screenshot 2024-07-05 10:02:36

Maybe the logic in ssd_titlebar_create needs similar changes as ssd_titlebar_update?

@jlindgren90
Copy link
Contributor

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.

@Consolatis
Copy link
Member Author

Consolatis commented Jul 5, 2024

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);
Copy link
Contributor

@tokyo4j tokyo4j Jul 7, 2024

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.

@johanmalm
Copy link
Collaborator

Set to draft until discussion in #1964 is concluded.

@ahesford
Copy link
Member

ahesford commented Sep 3, 2024

Superseded by #2116

@ahesford ahesford closed this Sep 3, 2024
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

Successfully merging this pull request may close these issues.

5 participants