[gimp] app: undeprecate gimpdisplayshell-layer-select
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: undeprecate gimpdisplayshell-layer-select
- Date: Tue, 3 Jul 2018 13:52:48 +0000 (UTC)
commit 67062a58679819715d70324385b0455fc2b5b56c
Author: Michael Natterer <mitch gimp org>
Date: Tue Jul 3 15:51:45 2018 +0200
app: undeprecate gimpdisplayshell-layer-select
app/display/gimpdisplayshell-layer-select.c | 32 ++++++++++++++++-------------
app/display/gimpdisplayshell-layer-select.h | 4 ++--
app/display/gimpdisplayshell-tool-events.c | 8 ++++----
3 files changed, 24 insertions(+), 20 deletions(-)
---
diff --git a/app/display/gimpdisplayshell-layer-select.c b/app/display/gimpdisplayshell-layer-select.c
index e118699840..c7e7ac72d0 100644
--- a/app/display/gimpdisplayshell-layer-select.c
+++ b/app/display/gimpdisplayshell-layer-select.c
@@ -60,7 +60,7 @@ static LayerSelect * layer_select_new (GimpDisplayShell *shell,
GimpLayer *layer,
gint view_size);
static void layer_select_destroy (LayerSelect *layer_select,
- guint32 time);
+ GdkEvent *event);
static void layer_select_advance (LayerSelect *layer_select,
gint move);
static gboolean layer_select_events (GtkWidget *widget,
@@ -72,8 +72,8 @@ static gboolean layer_select_events (GtkWidget *widget,
void
gimp_display_shell_layer_select_init (GimpDisplayShell *shell,
- gint move,
- guint32 time)
+ GdkEvent *event,
+ gint move)
{
LayerSelect *layer_select;
GimpImage *image;
@@ -81,6 +81,7 @@ gimp_display_shell_layer_select_init (GimpDisplayShell *shell,
GdkGrabStatus status;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
+ g_return_if_fail (event != NULL);
image = gimp_display_get_image (shell->display);
@@ -98,9 +99,16 @@ gimp_display_shell_layer_select_init (GimpDisplayShell *shell,
gtk_widget_show (layer_select->window);
- status = gdk_keyboard_grab (gtk_widget_get_window (layer_select->window), FALSE, time);
+ status = gdk_seat_grab (gdk_event_get_seat (event),
+ gtk_widget_get_window (layer_select->window),
+ GDK_SEAT_CAPABILITY_KEYBOARD,
+ FALSE, NULL, event, NULL, NULL);
+
if (status != GDK_GRAB_SUCCESS)
- g_printerr ("gdk_keyboard_grab failed with status %d\n", status);
+ {
+ g_printerr ("gdk_keyboard_grab failed with status %d\n", status);
+ layer_select_destroy (layer_select, event);
+ }
}
@@ -173,10 +181,9 @@ layer_select_new (GimpDisplayShell *shell,
static void
layer_select_destroy (LayerSelect *layer_select,
- guint32 time)
+ GdkEvent *event)
{
- gdk_display_keyboard_ungrab (gtk_widget_get_display (layer_select->window),
- time);
+ gdk_seat_ungrab (gdk_event_get_seat (event));
gtk_widget_destroy (layer_select->window);
@@ -243,15 +250,12 @@ layer_select_events (GtkWidget *widget,
GdkEvent *event,
LayerSelect *layer_select)
{
- GdkEventKey *kevent;
- GdkEventButton *bevent;
+ GdkEventKey *kevent;
switch (event->type)
{
case GDK_BUTTON_PRESS:
- bevent = (GdkEventButton *) event;
-
- layer_select_destroy (layer_select, bevent->time);
+ layer_select_destroy (layer_select, event);
break;
case GDK_KEY_PRESS:
@@ -286,7 +290,7 @@ layer_select_events (GtkWidget *widget,
}
if (! (kevent->state & GDK_CONTROL_MASK))
- layer_select_destroy (layer_select, kevent->time);
+ layer_select_destroy (layer_select, event);
return TRUE;
break;
diff --git a/app/display/gimpdisplayshell-layer-select.h b/app/display/gimpdisplayshell-layer-select.h
index 62632ec276..ce677e94a2 100644
--- a/app/display/gimpdisplayshell-layer-select.h
+++ b/app/display/gimpdisplayshell-layer-select.h
@@ -20,8 +20,8 @@
void gimp_display_shell_layer_select_init (GimpDisplayShell *shell,
- gint move,
- guint32 time);
+ GdkEvent *event,
+ gint move);
#endif /* __GIMP_DISPLAY_SHELL_LAYER_SELECT_H__ */
diff --git a/app/display/gimpdisplayshell-tool-events.c b/app/display/gimpdisplayshell-tool-events.c
index 2fec64b81a..00a0a71e1f 100644
--- a/app/display/gimpdisplayshell-tool-events.c
+++ b/app/display/gimpdisplayshell-tool-events.c
@@ -1703,11 +1703,11 @@ gimp_display_shell_tab_pressed (GimpDisplayShell *shell,
{
if (kevent->keyval == GDK_KEY_Tab ||
kevent->keyval == GDK_KEY_KP_Tab)
- gimp_display_shell_layer_select_init (shell,
- 1, kevent->time);
+ gimp_display_shell_layer_select_init (shell, (GdkEvent *) kevent,
+ 1);
else
- gimp_display_shell_layer_select_init (shell,
- -1, kevent->time);
+ gimp_display_shell_layer_select_init (shell, (GdkEvent *) kevent,
+ -1);
return TRUE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]