[gtk+/wip/baedert/drawing: 21/35] window: Fix resizing with solid-csd
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/drawing: 21/35] window: Fix resizing with solid-csd
- Date: Sat, 15 Jul 2017 14:42:05 +0000 (UTC)
commit ca961f8aef6523100fdf0a3688bfe8be16a91d79
Author: Timm Bäder <mail baedert org>
Date: Sun Jul 9 10:21:30 2017 +0200
window: Fix resizing with solid-csd
We can't use a 20px resize handle in that case so fall back to the
padding area of the window. Still ugly but it works.
gtk/gtkwindow.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkwindow.c b/gtk/gtkwindow.c
index f373903..e804609 100644
--- a/gtk/gtkwindow.c
+++ b/gtk/gtkwindow.c
@@ -1710,11 +1710,21 @@ edge_under_coordinates (GtkWindow *window,
_gtk_widget_get_allocation (GTK_WIDGET (window), &allocation);
context = _gtk_widget_get_style_context (GTK_WIDGET (window));
gtk_style_context_save_to_node (context, priv->decoration_node);
- gtk_style_context_get_margin (context, &border);
- gtk_style_context_restore (context);
- handle_h = MIN (RESIZE_HANDLE_SIZE, allocation.width / 2);
- handle_v = MIN (RESIZE_HANDLE_SIZE, allocation.height / 2);
+ if (priv->use_client_shadow)
+ {
+ handle_h = MIN (RESIZE_HANDLE_SIZE, allocation.width / 2);
+ handle_v = MIN (RESIZE_HANDLE_SIZE, allocation.height / 2);
+ gtk_style_context_get_margin (context, &border);
+ }
+ else
+ {
+ handle_h = 0;
+ handle_v = 0;
+ gtk_style_context_get_padding (context, &border);
+ }
+
+ gtk_style_context_restore (context);
/* Check whether the click falls outside the handle area */
if (x >= allocation.x + border.left + handle_h &&
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]