window: Hide the border when maximized
Dragging windows from the border is not useful when maximized.
This commit is contained in:
@ -5925,6 +5925,7 @@ get_decoration_borders (GtkWidget *widget,
|
|||||||
{
|
{
|
||||||
GtkStyleContext *context;
|
GtkStyleContext *context;
|
||||||
GtkStateFlags state;
|
GtkStateFlags state;
|
||||||
|
GdkWindow *window;
|
||||||
|
|
||||||
context = gtk_widget_get_style_context (widget);
|
context = gtk_widget_get_style_context (widget);
|
||||||
state = gtk_style_context_get_state (context);
|
state = gtk_style_context_get_state (context);
|
||||||
@ -5939,10 +5940,19 @@ get_decoration_borders (GtkWidget *widget,
|
|||||||
|
|
||||||
if (window_border != NULL)
|
if (window_border != NULL)
|
||||||
{
|
{
|
||||||
gtk_style_context_save (context);
|
window = gtk_widget_get_window (widget);
|
||||||
gtk_style_context_add_class (context, "window-border");
|
if (window != NULL && (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED) != 0)
|
||||||
gtk_style_context_get_border (context, state, window_border);
|
{
|
||||||
gtk_style_context_restore (context);
|
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 &&
|
if (priv->client_decorated &&
|
||||||
priv->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_style_context_add_class (context, "window-border");
|
||||||
gtk_widget_get_allocation (widget, &allocation);
|
gtk_widget_get_allocation (widget, &allocation);
|
||||||
|
|||||||
Reference in New Issue
Block a user