diff --git a/panels/meson.build b/panels/meson.build
index 29b96450c..5382bb034 100644
--- a/panels/meson.build
+++ b/panels/meson.build
@@ -39,7 +39,7 @@ if host_is_linux_not_s390
panels += [
'bluetooth',
'thunderbolt',
-# 'wacom'
+ 'wacom'
]
endif
diff --git a/panels/wacom/button-mapping.ui b/panels/wacom/button-mapping.ui
index 23b22262b..add7e454d 100644
--- a/panels/wacom/button-mapping.ui
+++ b/panels/wacom/button-mapping.ui
@@ -4,141 +4,73 @@
- False
True
- 5
Tablet Preferences
False
675
460
input-tablet
- dialog
-
+
- False
vertical
2
-
-
- False
- end
+
+
_Help
False
- True
- True
True
False
True
-
- False
- False
- 0
-
_Close
- False
- True
- True
- True
- False
True
-
- False
- False
- 1
-
-
- False
- True
- end
- 0
-
- True
- True
+ True
True
False
False
- True
- False
- True
- False
True
True
vertical
+
+ 0
+ 0
+ 3
+ 3
+
- True
False
- False
end
True
96
@@ -111,349 +81,238 @@
-
- False
- True
- 0
-
- True
- False
False
No tablet detected
center
1
-
- False
- False
- 1
-
- True
- False
start
True
Please plug in or turn on your Wacom tablet
center
0
-
- False
- True
- 2
-
-
- 0
- 0
- 3
- 3
-
Bluetooth Settings
- False
- True
- True
- True
end
end
True
- none
+
+ 2
+ 2
+
-
- 2
- 2
-
- True
- False
Plugin
-
- False
-
- True
- False
10
10
- True
- False
start
center
Wacom Tablet
+
+ 0
+ 0
+ 2
+
-
- 0
- 0
- 2
-
-
- True
- False
+
center
start
- wacom-tablet.svg
+ False
+ resource:///org/gnome/control-center/wacom/wacom-tablet.svg
+
+ 0
+ 1
+
-
- 0
- 1
-
- True
- False
16
vertical
10
10
+
+ 1
+ 1
+
- True
- False
end
center
Tracking Mode
+
+ 0
+ 0
+
-
- 0
- 0
-
- True
- False
True
liststore-tabletmode
+
+ 1
+ 0
+
-
- 1
- 0
-
- True
- False
end
center
Left-Handed Orientation
+
+ 0
+ 1
+
-
- 0
- 1
-
- False
- True
- True
start
center
+
+ 1
+ 1
+
-
- 1
- 1
-
- True
start
10
+
+ 1
+ 2
+
Map to Monitor…
- False
- True
- True
- True
-
- end
- 0
-
Map Buttons…
- False
False
- True
- True
-
- end
- 1
-
Calibrate…
- False
- True
- True
-
- end
- 2
-
-
- 1
- 2
-
Adjust mouse settings
- False
- True
- True
- True
start
start
- none
+
+ 1
+ 3
+
-
- 1
- 3
-
Adjust display resolution
- False
- True
- True
- True
start
start
- none
+
+ 1
+ 3
+
-
- 1
- 3
-
- True
- False
end
center
Decouple Display
+
+ 0
+ 4
+
-
- 0
- 4
-
- True
- True
start
center
True
+
+ 1
+ 4
+
-
- 1
- 4
-
Map to Monitor…
- False
- True
- True
- True
start
+
+ 1
+ 6
+
-
- 1
- 6
-
-
- 1
- 1
-
- True
- False
end
crossfade
100
-
-
-
+
+ 1
+ 0
+
-
- 1
- 0
-
-
- 1
-
- True
- False
Wacom
-
- 1
- False
-
-
- True
- True
- 1
-
diff --git a/panels/wacom/gsd-wacom-key-shortcut-button.c b/panels/wacom/gsd-wacom-key-shortcut-button.c
index fcc531372..aa15b0f84 100644
--- a/panels/wacom/gsd-wacom-key-shortcut-button.c
+++ b/panels/wacom/gsd-wacom-key-shortcut-button.c
@@ -60,8 +60,6 @@ struct _GsdWacomKeyShortcutButton
gboolean editing_mode;
- GdkSeat *grab_seat;
-
guint keyval;
guint keycode;
GdkModifierType mods;
@@ -168,40 +166,15 @@ static void
gsd_wacom_key_shortcut_set_editing_mode (GsdWacomKeyShortcutButton *self,
GdkEvent *event)
{
- GdkWindow *window;
- GdkSeat *seat;
-
self->editing_mode = TRUE;
gsd_wacom_key_shortcut_button_changed (self);
-
- window = gtk_widget_get_window (GTK_WIDGET (self));
-
- g_return_if_fail (window != NULL);
-
- seat = gdk_event_get_seat (event);
-
- if (gdk_seat_grab (seat, window, GDK_SEAT_CAPABILITY_ALL,
- FALSE, NULL, event, NULL, NULL) != GDK_GRAB_SUCCESS)
- return;
-
gtk_widget_grab_focus (GTK_WIDGET (self));
-
- self->grab_seat = seat;
}
static void
gsd_wacom_key_shortcut_remove_editing_mode (GsdWacomKeyShortcutButton *self)
{
self->editing_mode = FALSE;
-
- self->editing_mode = FALSE;
-
- if (self->grab_seat)
- {
- gdk_seat_ungrab (self->grab_seat);
- self->grab_seat = NULL;
- }
-
self->tmp_shortcut_keyval = 0;
self->tmp_shortcut_mods = 0;
self->tmp_shortcut_time = 0;
@@ -241,22 +214,10 @@ gsd_wacom_key_shortcut_button_activate (GtkButton *self)
GTK_BUTTON_CLASS (gsd_wacom_key_shortcut_button_parent_class)->activate (self);
}
-static void
-gsd_wacom_key_shortcut_button_init (GsdWacomKeyShortcutButton *self)
-{
- gtk_button_set_relief (GTK_BUTTON (self), GTK_RELIEF_NONE);
-
- self->cancel_keyval = DEFAULT_CANCEL_KEY;
- self->clear_keyval = DEFAULT_CLEAR_KEY;
-}
-
static void
key_shortcut_finished_editing (GsdWacomKeyShortcutButton *self,
guint32 time)
{
- gdk_seat_ungrab (self->grab_seat);
- self->grab_seat = NULL;
-
self->editing_mode = FALSE;
gsd_wacom_key_shortcut_remove_editing_mode (self);
@@ -265,17 +226,14 @@ key_shortcut_finished_editing (GsdWacomKeyShortcutButton *self,
}
static gboolean
-gsd_wacom_key_shortcut_button_key_release (GtkWidget *widget,
- GdkEventKey *event)
+gsd_wacom_key_shortcut_button_key_released_cb (GtkEventController *controller,
+ guint keyval,
+ guint keycode,
+ GdkModifierType state,
+ GsdWacomKeyShortcutButton *self)
{
- GsdWacomKeyShortcutButton *self = GSD_WACOM_KEY_SHORTCUT_BUTTON (widget);
-
if (self->tmp_shortcut_keyval == 0)
- {
- GTK_WIDGET_CLASS (gsd_wacom_key_shortcut_button_parent_class)->key_release_event (widget, event);
-
- return FALSE;
- }
+ return FALSE;
self->keyval = self->tmp_shortcut_keyval;
self->mods = self->tmp_shortcut_mods;
@@ -288,36 +246,34 @@ gsd_wacom_key_shortcut_button_key_release (GtkWidget *widget,
}
static gboolean
-gsd_wacom_key_shortcut_button_key_press (GtkWidget *widget,
- GdkEventKey *event)
+gsd_wacom_key_shortcut_button_key_pressed_cb (GtkEventController *controller,
+ guint keyval,
+ guint keycode,
+ GdkModifierType state,
+ GsdWacomKeyShortcutButton *self)
{
/* This code is based on the gtk_cell_renderer_accel_start_editing */
- GsdWacomKeyShortcutButton *self = GSD_WACOM_KEY_SHORTCUT_BUTTON (widget);
GdkModifierType mods = 0;
+ GdkEvent *event;
guint shortcut_keyval;
- guint keyval;
gboolean edited;
gboolean cleared;
+ event = gtk_event_controller_get_current_event (controller);
+
/* GTK and OTHER modes don't allow modifier keyvals */
- if (event->is_modifier && self->mode != GSD_WACOM_KEY_SHORTCUT_BUTTON_MODE_ALL)
+ if (gdk_key_event_is_modifier (event) && self->mode != GSD_WACOM_KEY_SHORTCUT_BUTTON_MODE_ALL)
return TRUE;
if (!self->editing_mode)
- {
- GTK_WIDGET_CLASS (gsd_wacom_key_shortcut_button_parent_class)->key_press_event (widget, event);
-
- return FALSE;
- }
+ return FALSE;
edited = FALSE;
cleared = FALSE;
- mods = event->state;
+ mods = state;
- keyval = event->keyval;
- if (keyval == GDK_KEY_Sys_Req &&
- (mods & GDK_MOD1_MASK) != 0)
+ if (keyval == GDK_KEY_Sys_Req && (mods & GDK_ALT_MASK) != 0)
{
/* HACK: we don't want to use SysRq as a keybinding (but we do
* want Alt+Print), so we avoid translation from Alt+Print to SysRq
@@ -356,7 +312,7 @@ gsd_wacom_key_shortcut_button_key_press (GtkWidget *widget,
self->tmp_shortcut_mods = 0;
self->tmp_shortcut_time = 0;
- if (event->is_modifier)
+ if (gdk_key_event_is_modifier (event))
{
/* when the user presses a non-modifier key, it readily assigns the
* shortcut but since we also support modifiers-only shortcuts, we
@@ -366,7 +322,7 @@ gsd_wacom_key_shortcut_button_key_press (GtkWidget *widget,
* it is a modifier shortcut and assign them when a key-release happens */
self->tmp_shortcut_keyval = shortcut_keyval;
self->tmp_shortcut_mods = mods;
- self->tmp_shortcut_time = event->time;
+ self->tmp_shortcut_time = gtk_event_controller_get_current_event_time (controller);
return TRUE;
}
@@ -387,7 +343,7 @@ gsd_wacom_key_shortcut_button_key_press (GtkWidget *widget,
self->mods = 0;
}
- key_shortcut_finished_editing (GSD_WACOM_KEY_SHORTCUT_BUTTON (widget), event->time);
+ key_shortcut_finished_editing (self, gtk_event_controller_get_current_event_time (controller));
if (edited)
g_signal_emit (self, signals[KEY_SHORTCUT_EDITED], 0);
@@ -397,23 +353,15 @@ gsd_wacom_key_shortcut_button_key_press (GtkWidget *widget,
return TRUE;
}
-static gboolean
-gsd_wacom_key_shortcut_button_button_press (GtkWidget *widget,
- GdkEventButton *event)
+static void
+gsd_wacom_key_shortcut_button_button_pressed_cb (GtkGestureClick *gesture,
+ gint n_press,
+ gdouble x,
+ gdouble y,
+ GsdWacomKeyShortcutButton *self)
{
- GsdWacomKeyShortcutButton *self;
-
- self = GSD_WACOM_KEY_SHORTCUT_BUTTON (widget);
-
- if (self->editing_mode)
- return TRUE;
-
- gsd_wacom_key_shortcut_set_editing_mode (self, NULL);
-
- GTK_WIDGET_CLASS (gsd_wacom_key_shortcut_button_parent_class)->button_press_event (widget,
- event);
-
- return TRUE;
+ if (!self->editing_mode)
+ gsd_wacom_key_shortcut_set_editing_mode (self, NULL);
}
static void
@@ -499,9 +447,6 @@ gsd_wacom_key_shortcut_button_class_init (GsdWacomKeyShortcutButtonClass *klass)
N_PROPERTIES,
obj_properties);
- widget_class->key_press_event = gsd_wacom_key_shortcut_button_key_press;
- widget_class->button_press_event = gsd_wacom_key_shortcut_button_button_press;
- widget_class->key_release_event = gsd_wacom_key_shortcut_button_key_release;
widget_class->unrealize = gsd_wacom_key_shortcut_button_unrealize;
button_class->activate = gsd_wacom_key_shortcut_button_activate;
@@ -538,6 +483,25 @@ gsd_wacom_key_shortcut_button_class_init (GsdWacomKeyShortcutButtonClass *klass)
G_TYPE_NONE, 0);
}
+static void
+gsd_wacom_key_shortcut_button_init (GsdWacomKeyShortcutButton *self)
+{
+ GtkEventController *controller;
+ GtkGesture *gesture;
+
+ self->cancel_keyval = DEFAULT_CANCEL_KEY;
+ self->clear_keyval = DEFAULT_CLEAR_KEY;
+
+ controller = gtk_event_controller_key_new ();
+ g_signal_connect (controller, "key-pressed", G_CALLBACK (gsd_wacom_key_shortcut_button_key_pressed_cb), self);
+ g_signal_connect (controller, "key-released", G_CALLBACK (gsd_wacom_key_shortcut_button_key_released_cb), self);
+ gtk_widget_add_controller (GTK_WIDGET (self), controller);
+
+ gesture = gtk_gesture_click_new ();
+ g_signal_connect (gesture, "pressed", G_CALLBACK (gsd_wacom_key_shortcut_button_button_pressed_cb), self);
+ gtk_widget_add_controller (GTK_WIDGET (self), GTK_EVENT_CONTROLLER (gesture));
+}
+
/**
* gsd_wacom_key_shortcut_button_new:
*
diff --git a/panels/wacom/meson.build b/panels/wacom/meson.build
index 5f6222071..30bbb6b04 100644
--- a/panels/wacom/meson.build
+++ b/panels/wacom/meson.build
@@ -1,5 +1,5 @@
-deps = wacom_deps + [
- gnome_desktop_dep,
+deps = common_deps + wacom_deps + [
+ gnome_rr_dep,
gnome_settings_dep,
x11_dep,
xi_dep
diff --git a/panels/wacom/test-wacom.c b/panels/wacom/test-wacom.c
index a8d4f6948..97803a12f 100644
--- a/panels/wacom/test-wacom.c
+++ b/panels/wacom/test-wacom.c
@@ -43,16 +43,6 @@ add_page (GList *devices,
gtk_widget_show (widget);
}
-static gboolean
-delete_event_cb (GtkWidget *widget,
- GdkEvent *event,
- gpointer user_data)
-{
- gtk_main_quit ();
-
- return FALSE;
-}
-
static GList *
create_fake_cintiq (void)
{
@@ -122,19 +112,16 @@ int main (int argc, char **argv)
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
textdomain (GETTEXT_PACKAGE);
- gtk_init (&argc, &argv);
+ gtk_init ();
- window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+ window = gtk_window_new ();
gtk_window_set_resizable (GTK_WINDOW (window), FALSE);
gtk_window_set_default_size (GTK_WINDOW (window), FIXED_WIDTH, -1);
- g_signal_connect (G_OBJECT (window), "delete-event",
- G_CALLBACK (delete_event_cb), NULL);
notebook = gtk_notebook_new ();
gtk_notebook_set_show_tabs (GTK_NOTEBOOK (notebook), FALSE);
gtk_notebook_set_show_border (GTK_NOTEBOOK (notebook), FALSE);
gtk_widget_set_vexpand (notebook, TRUE);
- gtk_container_set_border_width (GTK_CONTAINER (notebook), 24);
- gtk_container_add (GTK_CONTAINER (window), notebook);
+ gtk_window_set_child (GTK_WINDOW (window), notebook);
gtk_widget_show (notebook);
devices = create_fake_intuos4 ();
@@ -154,7 +141,8 @@ int main (int argc, char **argv)
gtk_widget_show (window);
- gtk_main ();
+ while (g_list_model_get_n_items (gtk_window_get_toplevels ()) > 0)
+ g_main_context_iteration (NULL, TRUE);
return 0;
}
diff --git a/panels/wacom/wacom-stylus-page.ui b/panels/wacom/wacom-stylus-page.ui
index 133f3c8fb..91d3e70c9 100644
--- a/panels/wacom/wacom-stylus-page.ui
+++ b/panels/wacom/wacom-stylus-page.ui
@@ -44,19 +44,13 @@
stylus-notebook
- True
- True
False
False
- True
- False
vertical
- True
- False
end
True
96
@@ -66,28 +60,14 @@
-
- False
- True
- 0
-
- True
- False
No stylus found
-
- False
- True
- 1
-
- True
- False
start
True
Please move your stylus to the proximity of the tablet to configure it
@@ -95,323 +75,242 @@
True
30
-
- False
- True
- 2
-
- True
- False
True
10
10
- True
- False
start
center
Stylus
+
+ 0
+ 0
+ 2
+
-
- 0
- 0
- 2
-
-
- True
- False
+
end
start
- wacom-stylus.svg
+ False
+ resource:///org/gnome/control-center/wacom/wacom-stylus.svg
+
+ 0
+ 1
+
-
- 0
- 1
-
- True
- False
16
12
True
vertical
6
10
+
+ 1
+ 1
+
- True
- False
end
center
Eraser Pressure Feel
right
+
+ 0
+ 0
+
-
- 0
- 0
-
- True
- False
True
10
+
+ 1
+ 0
+
- True
- False
Soft
-
- False
- True
- 0
-
- True
- True
center
+ True
adjustment-eraser-feel
0
False
0
-
- True
- True
- 1
-
- True
- False
Firm
-
- False
- True
- 2
-
-
- 1
- 0
-
- True
- False
end
center
Top Button
right
+
+ 0
+ 1
+
-
- 0
- 1
-
- True
- False
center
liststore-buttons
+
+ 1
+ 1
+
-
- 1
- 1
-
- True
- False
end
center
Lower Button
right
+
+ 0
+ 2
+
-
- 0
- 2
-
- True
- False
center
liststore-buttons
+
+ 1
+ 2
+
-
- 1
- 2
-
- True
- False
end
center
Lowest Button
right
+
+ 0
+ 3
+
-
- 0
- 3
-
- True
- False
center
liststore-buttons
+
+ 1
+ 3
+
-
- 1
- 3
-
- True
- False
end
center
Tip Pressure Feel
right
+
+ 0
+ 4
+
-
- 0
- 4
-
- True
- False
10
+
+ 1
+ 4
+
- True
- False
Soft
-
- False
- True
- 0
-
- True
- True
True
adjustment-tip-feel
0
False
0
-
- True
- True
- 1
-
- True
- False
Firm
-
- False
- True
- 2
-
-
- 1
- 4
-
-
- 1
- 1
-
- True
- False
end
crossfade
100
-
-
-
+
+ 1
+ 0
+
-
- 1
- 0
-
-
- 1
-
diff --git a/shell/cc-panel-loader.c b/shell/cc-panel-loader.c
index a3622ef86..31db92748 100644
--- a/shell/cc-panel-loader.c
+++ b/shell/cc-panel-loader.c
@@ -63,7 +63,7 @@ extern GType cc_bolt_panel_get_type (void);
extern GType cc_ua_panel_get_type (void);
//extern GType cc_user_panel_get_type (void);
#ifdef BUILD_WACOM
-//extern GType cc_wacom_panel_get_type (void);
+extern GType cc_wacom_panel_get_type (void);
#endif /* BUILD_WACOM */
#ifdef BUILD_WWAN
//extern GType cc_wwan_panel_get_type (void);
@@ -81,7 +81,7 @@ extern void cc_diagnostics_panel_static_init_func (void);
//extern void cc_wifi_panel_static_init_func (void);
#endif /* BUILD_NETWORK */
#ifdef BUILD_WACOM
-//extern void cc_wacom_panel_static_init_func (void);
+extern void cc_wacom_panel_static_init_func (void);
#endif /* BUILD_WACOM */
#ifdef BUILD_WWAN
//extern void cc_wwan_panel_static_init_func (void);
@@ -135,7 +135,7 @@ static CcPanelLoaderVtable default_panels[] =
PANEL_TYPE("usage", cc_usage_panel_get_type, NULL),
//PANEL_TYPE("user-accounts", cc_user_panel_get_type, NULL),
#ifdef BUILD_WACOM
- //PANEL_TYPE("wacom", cc_wacom_panel_get_type, cc_wacom_panel_static_init_func),
+ PANEL_TYPE("wacom", cc_wacom_panel_get_type, cc_wacom_panel_static_init_func),
#endif
#ifdef BUILD_WWAN
//PANEL_TYPE("wwan", cc_wwan_panel_get_type, cc_wwan_panel_static_init_func),