Skip to content

new initial window size algorithm - #380

Open
xBZZZZ wants to merge 1 commit into
mate-desktop:masterfrom
xBZZZZ:s
Open

new initial window size algorithm#380
xBZZZZ wants to merge 1 commit into
mate-desktop:masterfrom
xBZZZZ:s

Conversation

@xBZZZZ

@xBZZZZ xBZZZZ commented Jun 21, 2026

Copy link
Copy Markdown
  • old algorithm:
  • new algorithm:

@cwendling cwendling left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a complete review and I didn't look into the logic changes yet, but there's a few things that should be changed in any case.

Comment thread src/eom-window.c Outdated
Comment thread src/eom-window.c
Comment thread src/eom-window.c Outdated
Comment thread src/eom-window.c Outdated

@lukefromdc lukefromdc left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested this as requested in the wayland session (with wayfire). As of now wayfire scales down the oversize window of an oversize image with master, but with this applied this window is scaled down slightly smaller. Different logic, different scaledown, indicating this seems to work fine in wayfire and thus more broadly in wlroots based wayland compositors.

Comment thread src/eom-window.c Outdated
Comment thread src/eom-window.c
gtk_widget_get_allocation (window->priv->view, &view_rect);

GdkRectangle window_rect;
gtk_widget_get_allocation (GTK_WIDGET (window), &window_rect);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You removed the gtk_widget_realize (GTK_WIDGET (window)); above, but are reading the allocation here. This might return garbage.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gtk_widget_realize also does gtk_widget_realize parent widget: https://github.com/GNOME/gtk/blob/369c97465c780b25e43b30747de0734ddf420770/gtk/gtkwidget.c#L5524

can window not be parent (of parent of parent …) of window->priv->view?

old algorithm's windows don't fit on screen
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.

4 participants