window: Hide the border when maximized

Dragging windows from the border is not useful when maximized.
This commit is contained in:
Matthias Clasen 2013-03-10 03:30:26 -04:00
parent 003d9f4225
commit 41aad21693

View File

@ -5925,6 +5925,7 @@ get_decoration_borders (GtkWidget *widget,
{
GtkStyleContext *context;
GtkStateFlags state;
GdkWindow *window;
context = gtk_widget_get_style_context (widget);
state = gtk_style_context_get_state (context);
@ -5939,10 +5940,19 @@ get_decoration_borders (GtkWidget *widget,
if (window_border != NULL)
{
gtk_style_context_save (context);
gtk_style_context_add_class (context, "window-border");
gtk_style_context_get_border (context, state, window_border);
gtk_style_context_restore (context);
window = gtk_widget_get_window (widget);
if (window != NULL && (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED) != 0)
{
GtkBorder empty = { 0 };
*window_border = empty;
}
else
{
gtk_style_context_save (context);
gtk_style_context_add_class (context, "window-border");
gtk_style_context_get_border (context, state, window_border);
gtk_style_context_restore (context);
}
}
}
@ -8815,7 +8825,8 @@ gtk_window_draw (GtkWidget *widget,
if (priv->client_decorated &&
priv->decorated &&
!priv->fullscreen)
!priv->fullscreen &&
!(gdk_window_get_state (gtk_widget_get_window (widget)) & GDK_WINDOW_STATE_MAXIMIZED))
{
gtk_style_context_add_class (context, "window-border");
gtk_widget_get_allocation (widget, &allocation);