[gtk+/wip/csd-for-review] Add a separate window-border class for maximized windows
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/csd-for-review] Add a separate window-border class for maximized windows
- Date: Mon, 11 Mar 2013 02:03:46 +0000 (UTC)
commit 3c3d91fbc88e270570a367549fc4b2dc9590d0a8
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Mar 10 03:30:26 2013 -0400
Add a separate window-border class for maximized windows
This is useful to hide a the window border for maximized
windows. Dragging them from the border is not useful when maximized.
gtk/gtkwindow.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index 85ef9aa..d5233dc 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -5844,6 +5844,7 @@ get_decoration_borders (GtkWidget *widget,
{
GtkStyleContext *context;
GtkStateFlags state;
+ GdkWindow *window;
if (!title_border && !window_border)
return;
@@ -5862,7 +5863,11 @@ get_decoration_borders (GtkWidget *widget,
if (window_border)
{
gtk_style_context_save (context);
- gtk_style_context_add_class (context, "window-border");
+ window = gtk_widget_get_window (widget);
+ if (window != NULL && (gdk_window_get_state (window) & GDK_WINDOW_STATE_MAXIMIZED) != 0)
+ gtk_style_context_add_class (context, "window-border-maximized");
+ else
+ gtk_style_context_add_class (context, "window-border");
gtk_style_context_get_border (context, state, window_border);
gtk_style_context_restore (context);
}
@@ -8752,7 +8757,10 @@ gtk_window_draw (GtkWidget *widget,
priv->type == GTK_WINDOW_TOPLEVEL &&
!priv->fullscreen)
{
- gtk_style_context_add_class (context, "window-border");
+ if (gdk_window_get_state (gtk_widget_get_window (widget)) & GDK_WINDOW_STATE_MAXIMIZED)
+ gtk_style_context_add_class (context, "window-border-maximized");
+ else
+ gtk_style_context_add_class (context, "window-border");
gtk_widget_get_allocation (widget, &allocation);
gtk_render_background (context, cr,
window_border.left,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]