mirror of
https://github.com/brl/mutter.git
synced 2024-11-27 02:20:43 -05:00
tests/test-client: Make 'resize' client command include the titlebar
To get some kind of consistency between what 'resize' means for the compositor and the client, make the size correspond to the "frame rect" of the window, i.e. the window geometry in the Wayland case, and the window size including the titlebar in the X11 case. This is so that the window size later can be reliably compared both in the compositor and in the client using the same expected dimensions. https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1171
This commit is contained in:
parent
965d74355a
commit
d812cecc44
@ -242,6 +242,18 @@ handle_take_focus (GtkWidget *window,
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
calculate_titlebar_height (GtkWindow *window)
|
||||
{
|
||||
GtkWidget *titlebar;
|
||||
|
||||
titlebar = gtk_window_get_titlebar (window);
|
||||
if (!titlebar)
|
||||
return 0;
|
||||
|
||||
return gtk_widget_get_allocated_height (titlebar);
|
||||
}
|
||||
|
||||
static void
|
||||
process_line (const char *line)
|
||||
{
|
||||
@ -565,7 +577,10 @@ process_line (const char *line)
|
||||
|
||||
int width = atoi (argv[2]);
|
||||
int height = atoi (argv[3]);
|
||||
gtk_window_resize (GTK_WINDOW (window), width, height);
|
||||
int titlebar_height = calculate_titlebar_height (GTK_WINDOW (window));
|
||||
gtk_window_resize (GTK_WINDOW (window),
|
||||
width,
|
||||
height - titlebar_height);
|
||||
}
|
||||
else if (strcmp (argv[0], "raise") == 0)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user