xed-window: Fix getting the wrong window size when cloning a window

This was mostly caused by a missing set of parens resulting in the wrong logic
being used. Go ahead a clean things up just a bit while I'm here.
This commit is contained in:
JosephMcc 2017-02-09 10:30:52 -08:00
parent 399fc81a41
commit 69f71de2de
1 changed files with 11 additions and 13 deletions

View File

@ -268,7 +268,7 @@ xed_window_configure_event (GtkWidget *widget,
XedWindow *window = XED_WINDOW (widget); XedWindow *window = XED_WINDOW (widget);
if (gtk_widget_get_realized (widget) && if (gtk_widget_get_realized (widget) &&
window->priv->state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN) == 0) (window->priv->state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN)) == 0)
{ {
save_window_state (widget); save_window_state (widget);
} }
@ -1808,16 +1808,14 @@ clone_window (XedWindow *origin)
screen = gtk_window_get_screen (GTK_WINDOW (origin)); screen = gtk_window_get_screen (GTK_WINDOW (origin));
window = xed_app_create_window (app, screen); window = xed_app_create_window (app, screen);
gtk_window_set_default_size (GTK_WINDOW (window), origin->priv->width, origin->priv->height);
if ((origin->priv->window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0) if ((origin->priv->window_state & GDK_WINDOW_STATE_MAXIMIZED) != 0)
{ {
gint w, h;
_xed_window_get_default_size (&w, &h);
gtk_window_set_default_size (GTK_WINDOW(window), w, h);
gtk_window_maximize (GTK_WINDOW (window)); gtk_window_maximize (GTK_WINDOW (window));
} }
else else
{ {
gtk_window_set_default_size (GTK_WINDOW(window), origin->priv->width, origin->priv->height);
gtk_window_unmaximize (GTK_WINDOW (window)); gtk_window_unmaximize (GTK_WINDOW (window));
} }