diff options
10 files changed, 6 insertions, 1443 deletions
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/0001-xsettings.xml-remove-trouble-causing-comment.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/0001-xsettings.xml-remove-trouble-causing-comment.patch deleted file mode 100644 index f926a93d44..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/0001-xsettings.xml-remove-trouble-causing-comment.patch +++ /dev/null | |||
| @@ -1,31 +0,0 @@ | |||
| 1 | From a84a7a6537544cdf56e1d4cad47a4cf002964039 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Sun, 20 May 2012 15:20:08 +0200 | ||
| 4 | Subject: [PATCH 1/2] xsettings.xml: remove trouble causing comment | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | Upstream-Status: Pending | ||
| 9 | |||
| 10 | |||
| 11 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 12 | --- | ||
| 13 | xfsettingsd/xsettings.xml | 5 ----- | ||
| 14 | 1 files changed, 0 insertions(+), 5 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/xfsettingsd/xsettings.xml b/xfsettingsd/xsettings.xml | ||
| 17 | index 8f9e2eb..49a4c1e 100644 | ||
| 18 | --- a/xfsettingsd/xsettings.xml | ||
| 19 | +++ b/xfsettingsd/xsettings.xml | ||
| 20 | @@ -1,8 +1,3 @@ | ||
| 21 | -<!-- | ||
| 22 | - Default values for the X settings registry as described in | ||
| 23 | - http://www.freedesktop.org/wiki/Specifications/XSettingsRegistry | ||
| 24 | ---> | ||
| 25 | - | ||
| 26 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 27 | <channel name="xsettings" version="1.0"> | ||
| 28 | <property name="Net" type="empty"> | ||
| 29 | -- | ||
| 30 | 1.7.4.4 | ||
| 31 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/0002-xsettings.xml-Set-default-themes.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/0002-xsettings.xml-Set-default-themes.patch deleted file mode 100644 index 44478e6d83..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/0002-xsettings.xml-Set-default-themes.patch +++ /dev/null | |||
| @@ -1,32 +0,0 @@ | |||
| 1 | From 071a390ba09a8a412f73d295be81a805804a1f24 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Sun, 20 May 2012 15:22:09 +0200 | ||
| 4 | Subject: [PATCH 2/2] xsettings.xml: Set default themes | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | Upstram status: Inappropriate [configuration] | ||
| 9 | |||
| 10 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 11 | --- | ||
| 12 | xfsettingsd/xsettings.xml | 4 ++-- | ||
| 13 | 1 files changed, 2 insertions(+), 2 deletions(-) | ||
| 14 | |||
| 15 | diff --git a/xfsettingsd/xsettings.xml b/xfsettingsd/xsettings.xml | ||
| 16 | index 49a4c1e..5ec94e9 100644 | ||
| 17 | --- a/xfsettingsd/xsettings.xml | ||
| 18 | +++ b/xfsettingsd/xsettings.xml | ||
| 19 | @@ -1,8 +1,8 @@ | ||
| 20 | <?xml version="1.0" encoding="UTF-8"?> | ||
| 21 | <channel name="xsettings" version="1.0"> | ||
| 22 | <property name="Net" type="empty"> | ||
| 23 | - <property name="ThemeName" type="empty"/> | ||
| 24 | - <property name="IconThemeName" type="empty"/> | ||
| 25 | + <property name="ThemeName" type="string" value="Xfce"/> | ||
| 26 | + <property name="IconThemeName" type="string" value="gnome"/> | ||
| 27 | <property name="DoubleClickTime" type="int" value="400"/> | ||
| 28 | <property name="DoubleClickDistance" type="int" value="5"/> | ||
| 29 | <property name="DndDragThreshold" type="int" value="8"/> | ||
| 30 | -- | ||
| 31 | 1.7.4.4 | ||
| 32 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0001-add-cursor-theme-xfce-invisible.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0001-add-cursor-theme-xfce-invisible.patch deleted file mode 100644 index 5de14fc8e2..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0001-add-cursor-theme-xfce-invisible.patch +++ /dev/null | |||
| @@ -1,248 +0,0 @@ | |||
| 1 | From 4be18d7c8f2ac72b402dcbe8385922638fcd0a89 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Tue, 30 Oct 2012 13:14:11 +0100 | ||
| 4 | Subject: [PATCH 1/5] add cursor-theme "xfce-invisible" | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 10 | Upstream-Status: Submitted [1] | ||
| 11 | [1] https://bugzilla.xfce.org/show_bug.cgi?id=9474 | ||
| 12 | --- | ||
| 13 | Makefile.am | 1 + | ||
| 14 | configure.ac.in | 2 + | ||
| 15 | cursors/Makefile.am | 178 +++++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| 16 | cursors/index.theme | 3 + | ||
| 17 | 6 files changed, 184 insertions(+), 0 deletions(-) | ||
| 18 | create mode 100644 cursors/Makefile.am | ||
| 19 | create mode 100644 cursors/index.theme | ||
| 20 | |||
| 21 | diff --git a/Makefile.am b/Makefile.am | ||
| 22 | index 3060bac..3f0dd1d 100644 | ||
| 23 | --- a/Makefile.am | ||
| 24 | +++ b/Makefile.am | ||
| 25 | @@ -1,6 +1,7 @@ | ||
| 26 | # $Id$ | ||
| 27 | |||
| 28 | SUBDIRS = \ | ||
| 29 | + cursors \ | ||
| 30 | dialogs \ | ||
| 31 | xfce4-settings-manager \ | ||
| 32 | xfce4-settings-editor \ | ||
| 33 | diff --git a/configure.ac.in b/configure.ac.in | ||
| 34 | index 0e7907d..1378049 100644 | ||
| 35 | --- a/configure.ac.in | ||
| 36 | +++ b/configure.ac.in | ||
| 37 | @@ -157,6 +157,7 @@ dnl *** Optional support for Xcursor *** | ||
| 38 | dnl ************************************ | ||
| 39 | XDT_CHECK_OPTIONAL_PACKAGE([XCURSOR], [xcursor], [1.1.0], | ||
| 40 | [xcursor], [Cursor themes support]) | ||
| 41 | +AC_SUBST(cursordir, "\${datadir}/icons/xfce-invisible/cursors") | ||
| 42 | |||
| 43 | dnl **************************************** | ||
| 44 | dnl *** Optional support for Libxklavier *** | ||
| 45 | @@ -232,6 +233,7 @@ AC_SUBST([PLATFORM_LDFLAGS]) | ||
| 46 | AC_OUTPUT([ | ||
| 47 | Makefile | ||
| 48 | po/Makefile.in | ||
| 49 | +cursors/Makefile | ||
| 50 | dialogs/Makefile | ||
| 51 | dialogs/appearance-settings/Makefile | ||
| 52 | dialogs/accessibility-settings/Makefile | ||
| 53 | diff --git a/cursors/Makefile.am b/cursors/Makefile.am | ||
| 54 | new file mode 100644 | ||
| 55 | index 0000000..c9e5a9f | ||
| 56 | --- /dev/null | ||
| 57 | +++ b/cursors/Makefile.am | ||
| 58 | @@ -0,0 +1,178 @@ | ||
| 59 | +CURSOR_NAMES_INVISIBLE = \ | ||
| 60 | + 00008160000006810000408080010102 \ | ||
| 61 | + 028006030e0e7ebffc7f7070c0600140 \ | ||
| 62 | + 2870a09082c103050810ffdffffe0204 \ | ||
| 63 | + 03b6e0fcb3499374a867c041f52298f0 \ | ||
| 64 | + 0876e1c15ff2fc01f906f1c363074c0f \ | ||
| 65 | + 08ffe1cb5fe6fc01f906f1c063814ccf \ | ||
| 66 | + 08ffe1e65f80fcfdf9fff11263e74c48 \ | ||
| 67 | + 1001208387f90000800003000700f6ff \ | ||
| 68 | + 1081e37283d90000800003c07f3ef6bf \ | ||
| 69 | + 14fef782d02440884392942c11205230 \ | ||
| 70 | + 208530c400c041818281048008011002 \ | ||
| 71 | + 3085a0e285430894940527032f8b26df \ | ||
| 72 | + 4498f0e0c1937ffe01fd06f973665830 \ | ||
| 73 | + 5aca4d189052212118709018842178c0 \ | ||
| 74 | + 5c6cd98b3f3ebcb1f9c7f1c204630408 \ | ||
| 75 | + 6407b0e94181790501fd1e167b474872 \ | ||
| 76 | + 640fb0e74195791501fd1ed57b41487f \ | ||
| 77 | + 9081237383d90e509aa00f00170e968f \ | ||
| 78 | + 9d800788f1b08800ae810202380a0822 \ | ||
| 79 | + a2a266d0498c3104214a47bd64ab0fc8 \ | ||
| 80 | + b66166c04f8c3109214a4fbd64a50fc8 \ | ||
| 81 | + c7088f0f3e6c8088236ef8e1e3e70000 \ | ||
| 82 | + d9ce0ab605698f320427677b458ad60b \ | ||
| 83 | + e29285e634086352946a0e7090d73106 \ | ||
| 84 | + f41c0e382c94c0958e07017e42b00462 \ | ||
| 85 | + f41c0e382c97c0938e07017e42800402 \ | ||
| 86 | + fcf1c3c7cd4491d801f1e1c78f100000 \ | ||
| 87 | + fcf21c00b30f7e3f83fe0dfd12e71cff \ | ||
| 88 | + alias \ | ||
| 89 | + all-scroll \ | ||
| 90 | + arrow \ | ||
| 91 | + base_arrow_down \ | ||
| 92 | + base_arrow_up \ | ||
| 93 | + based_arrow_down \ | ||
| 94 | + based_arrow_up \ | ||
| 95 | + bd_double_arrow \ | ||
| 96 | + boat \ | ||
| 97 | + bottom_left_corner \ | ||
| 98 | + bottom_right_corner \ | ||
| 99 | + bottom_side \ | ||
| 100 | + bottom_tee \ | ||
| 101 | + cell \ | ||
| 102 | + center_ptr \ | ||
| 103 | + circle \ | ||
| 104 | + closedhand \ | ||
| 105 | + color-picker \ | ||
| 106 | + col-resize \ | ||
| 107 | + copy \ | ||
| 108 | + cross \ | ||
| 109 | + cross_reverse \ | ||
| 110 | + crossed_circle \ | ||
| 111 | + crosshair \ | ||
| 112 | + default \ | ||
| 113 | + diamond_cross \ | ||
| 114 | + dnd-ask \ | ||
| 115 | + dnd-copy \ | ||
| 116 | + dnd-link \ | ||
| 117 | + dnd-move \ | ||
| 118 | + dnd-no-drop \ | ||
| 119 | + dnd-none \ | ||
| 120 | + dot \ | ||
| 121 | + dot_box_mask \ | ||
| 122 | + dotbox \ | ||
| 123 | + double_arrow \ | ||
| 124 | + down_arrow \ | ||
| 125 | + draft_large \ | ||
| 126 | + draft_small \ | ||
| 127 | + draped_box \ | ||
| 128 | + e-resize \ | ||
| 129 | + ew-resize \ | ||
| 130 | + exchange \ | ||
| 131 | + fd_double_arrow \ | ||
| 132 | + fleur \ | ||
| 133 | + forbidden \ | ||
| 134 | + grab \ | ||
| 135 | + grabbing \ | ||
| 136 | + gumby \ | ||
| 137 | + h_double_arrow \ | ||
| 138 | + hand \ | ||
| 139 | + hand1 \ | ||
| 140 | + hand2 \ | ||
| 141 | + help \ | ||
| 142 | + ibeam \ | ||
| 143 | + icon \ | ||
| 144 | + left_arrow \ | ||
| 145 | + left_ptr \ | ||
| 146 | + left_side \ | ||
| 147 | + left_tee \ | ||
| 148 | + link \ | ||
| 149 | + ll_angle \ | ||
| 150 | + lr_angle \ | ||
| 151 | + move \ | ||
| 152 | + ne-resize \ | ||
| 153 | + nesw-resize \ | ||
| 154 | + no-drop \ | ||
| 155 | + not-allowed \ | ||
| 156 | + n-resize \ | ||
| 157 | + ns-resize \ | ||
| 158 | + nw-resize \ | ||
| 159 | + nwse-resize \ | ||
| 160 | + openhand \ | ||
| 161 | + pencil \ | ||
| 162 | + pirate \ | ||
| 163 | + plus \ | ||
| 164 | + pointer \ | ||
| 165 | + pointing_hand \ | ||
| 166 | + question_arrow \ | ||
| 167 | + right_arrow \ | ||
| 168 | + right_ptr \ | ||
| 169 | + right_side \ | ||
| 170 | + right_tee \ | ||
| 171 | + row-resize \ | ||
| 172 | + sailboat \ | ||
| 173 | + sb_down_arrow \ | ||
| 174 | + sb_h_double_arrow \ | ||
| 175 | + sb_left_arrow \ | ||
| 176 | + sb_right_arrow \ | ||
| 177 | + sb_up_arrow \ | ||
| 178 | + sb_v_double_arrow \ | ||
| 179 | + se-resize \ | ||
| 180 | + size_all \ | ||
| 181 | + size_bdiag \ | ||
| 182 | + size_fdiag \ | ||
| 183 | + size_hor \ | ||
| 184 | + size_ver \ | ||
| 185 | + sizing \ | ||
| 186 | + shuttle \ | ||
| 187 | + split_h \ | ||
| 188 | + split_v \ | ||
| 189 | + s-resize \ | ||
| 190 | + sw-resize \ | ||
| 191 | + target \ | ||
| 192 | + tcross \ | ||
| 193 | + text \ | ||
| 194 | + top_left_arrow \ | ||
| 195 | + top_left_corner \ | ||
| 196 | + top_right_corner \ | ||
| 197 | + top_side \ | ||
| 198 | + top_tee \ | ||
| 199 | + trek \ | ||
| 200 | + ul_angle \ | ||
| 201 | + up_arrow \ | ||
| 202 | + ur_angle \ | ||
| 203 | + vertical-text \ | ||
| 204 | + v_double_arrow \ | ||
| 205 | + whats_this \ | ||
| 206 | + w-resize \ | ||
| 207 | + X_cursor \ | ||
| 208 | + xterm \ | ||
| 209 | + zoom-in \ | ||
| 210 | + zoom-out | ||
| 211 | + | ||
| 212 | +CURSOR_NAMES = \ | ||
| 213 | + 3ecb610c1bf2410f44200f48c40d3599 \ | ||
| 214 | + 08e8e1c95fe2fc01f976f1e063a24ccd \ | ||
| 215 | + 00000000000000020006000e7e9ffc3f \ | ||
| 216 | + half-busy \ | ||
| 217 | + left_ptr_watch \ | ||
| 218 | + progress \ | ||
| 219 | + watch | ||
| 220 | + | ||
| 221 | + | ||
| 222 | +EXTRA_DIST = invisible wait index.theme | ||
| 223 | + | ||
| 224 | +install-data-local: | ||
| 225 | + $(mkinstalldirs) $(DESTDIR)@cursordir@; | ||
| 226 | + $(INSTALL_DATA) $(srcdir)/index.theme $(DESTDIR)/@cursordir@/.. | ||
| 227 | + $(INSTALL_DATA) $(srcdir)/invisible $(srcdir)/wait $(DESTDIR)@cursordir@/ | ||
| 228 | + for CURSOR in $(CURSOR_NAMES_INVISIBLE); do \ | ||
| 229 | + echo '-- Installing invisible cursor '$$CURSOR; \ | ||
| 230 | + ln -s $(srcdir)/invisible $(DESTDIR)@cursordir@/$$CURSOR; \ | ||
| 231 | + done | ||
| 232 | + for CURSOR in $(CURSOR_NAMES); do \ | ||
| 233 | + echo '-- Installing visible cursor '$$CURSOR; \ | ||
| 234 | + ln -s $(srcdir)/wait $(DESTDIR)@cursordir@/$$CURSOR; \ | ||
| 235 | + done | ||
| 236 | + | ||
| 237 | diff --git a/cursors/index.theme b/cursors/index.theme | ||
| 238 | new file mode 100644 | ||
| 239 | index 0000000..0c48458 | ||
| 240 | --- /dev/null | ||
| 241 | +++ b/cursors/index.theme | ||
| 242 | @@ -0,0 +1,3 @@ | ||
| 243 | +[Icon Theme] | ||
| 244 | +Name=xfce-invisible | ||
| 245 | +Example=invisible | ||
| 246 | -- | ||
| 247 | 1.7.6.5 | ||
| 248 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0002-mouse-settings-dialog-add-touchscreen-pointer-option.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0002-mouse-settings-dialog-add-touchscreen-pointer-option.patch deleted file mode 100644 index cf58f73d8d..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0002-mouse-settings-dialog-add-touchscreen-pointer-option.patch +++ /dev/null | |||
| @@ -1,152 +0,0 @@ | |||
| 1 | From 7c87f8f202a7743a18b8d7fdab5c66a3d54badd5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Thu, 1 Nov 2012 21:01:59 +0100 | ||
| 4 | Subject: [PATCH 2/5] mouse settings dialog: add touchscreen-pointer option | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | |||
| 10 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 11 | Upstream-Status: Submitted [1] | ||
| 12 | [1] https://bugzilla.xfce.org/show_bug.cgi?id=9474 | ||
| 13 | --- | ||
| 14 | dialogs/mouse-settings/main.c | 56 +++++++++++++++++++++++++++++ | ||
| 15 | dialogs/mouse-settings/mouse-dialog.glade | 28 ++++++++++++++- | ||
| 16 | 3 files changed, 422 insertions(+), 329 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/dialogs/mouse-settings/main.c b/dialogs/mouse-settings/main.c | ||
| 19 | index f4b475b..ff08219 100644 | ||
| 20 | --- a/dialogs/mouse-settings/main.c | ||
| 21 | +++ b/dialogs/mouse-settings/main.c | ||
| 22 | @@ -956,6 +956,50 @@ mouse_settings_device_set_enabled (GtkToggleButton *button, | ||
| 23 | |||
| 24 | |||
| 25 | |||
| 26 | +#ifdef HAVE_XCURSOR | ||
| 27 | +static void | ||
| 28 | +mouse_settings_on_touchscreen_pointer (GtkToggleButton *button, | ||
| 29 | + GtkBuilder *builder) | ||
| 30 | +{ | ||
| 31 | + gchar *name = NULL; | ||
| 32 | + gchar *prop; | ||
| 33 | + gboolean enabled; | ||
| 34 | + | ||
| 35 | + if (locked > 0) | ||
| 36 | + return; | ||
| 37 | + | ||
| 38 | + if (mouse_settings_device_get_selected (builder, NULL, &name)) | ||
| 39 | + { | ||
| 40 | + enabled = gtk_toggle_button_get_active (button); | ||
| 41 | + prop = g_strconcat ("/", name, "/TouchscreenPointer", NULL); | ||
| 42 | + xfconf_channel_set_bool (pointers_channel, prop, enabled); | ||
| 43 | + g_free (prop); | ||
| 44 | + } | ||
| 45 | + g_free (name); | ||
| 46 | +} | ||
| 47 | + | ||
| 48 | +static void | ||
| 49 | +mouse_settings_set_touchscreen_pointer (GtkBuilder *builder) | ||
| 50 | +{ | ||
| 51 | + gchar *name = NULL; | ||
| 52 | + gchar *prop; | ||
| 53 | + gboolean enabled; | ||
| 54 | + GtkToggleButton *button; | ||
| 55 | + | ||
| 56 | + if (mouse_settings_device_get_selected (builder, NULL, &name)) | ||
| 57 | + { | ||
| 58 | + button = GTK_TOGGLE_BUTTON (gtk_builder_get_object (builder, "touchscreen-pointer")); | ||
| 59 | + prop = g_strconcat ("/", name, "/TouchscreenPointer", NULL); | ||
| 60 | + enabled = xfconf_channel_get_bool (pointers_channel, prop, FALSE); | ||
| 61 | + gtk_toggle_button_set_active (button, enabled); | ||
| 62 | + g_free (prop); | ||
| 63 | + } | ||
| 64 | + g_free (name); | ||
| 65 | +} | ||
| 66 | +#endif | ||
| 67 | + | ||
| 68 | + | ||
| 69 | + | ||
| 70 | static void | ||
| 71 | mouse_settings_device_selection_changed (GtkBuilder *builder) | ||
| 72 | { | ||
| 73 | @@ -1007,6 +1051,9 @@ mouse_settings_device_selection_changed (GtkBuilder *builder) | ||
| 74 | /* get the selected item */ | ||
| 75 | if (mouse_settings_device_get_selected (builder, &device, NULL)) | ||
| 76 | { | ||
| 77 | +#ifdef HAVE_XCURSOR | ||
| 78 | + mouse_settings_set_touchscreen_pointer (builder); | ||
| 79 | +#endif | ||
| 80 | gdk_error_trap_push (); | ||
| 81 | device_info = XListInputDevices (xdisplay, &ndevices); | ||
| 82 | if (gdk_error_trap_pop () == 0 && device_info != NULL) | ||
| 83 | @@ -1735,11 +1782,20 @@ main (gint argc, gchar **argv) | ||
| 84 | /* populate the themes treeview */ | ||
| 85 | mouse_settings_themes_populate_store (builder); | ||
| 86 | |||
| 87 | + /* connect & fill touchscreen-pointer */ | ||
| 88 | + object = gtk_builder_get_object (builder, "touchscreen-pointer"); | ||
| 89 | + g_signal_connect (G_OBJECT (object), "toggled", | ||
| 90 | + G_CALLBACK (mouse_settings_on_touchscreen_pointer), builder); | ||
| 91 | + mouse_settings_set_touchscreen_pointer (builder); | ||
| 92 | + | ||
| 93 | /* connect the cursor size in the cursor tab */ | ||
| 94 | object = gtk_builder_get_object (builder, "theme-cursor-size"); | ||
| 95 | xfconf_g_property_bind (xsettings_channel, "/Gtk/CursorThemeSize", | ||
| 96 | G_TYPE_INT, G_OBJECT (object), "value"); | ||
| 97 | #else | ||
| 98 | + /* hide touchscreen-pointer */ | ||
| 99 | + object = gtk_builder_get_object (builder, "touchscreen-pointer"); | ||
| 100 | + gtk_widget_hide (GTK_WIDGET (object)); | ||
| 101 | /* hide the themes tab */ | ||
| 102 | object = gtk_builder_get_object (builder, "themes-hbox"); | ||
| 103 | gtk_widget_hide (GTK_WIDGET (object)); | ||
| 104 | diff --git a/dialogs/mouse-settings/mouse-dialog.glade b/dialogs/mouse-settings/mouse-dialog.glade | ||
| 105 | index d3aab0d..573c551 100644 | ||
| 106 | --- a/dialogs/mouse-settings/mouse-dialog.glade | ||
| 107 | +++ b/dialogs/mouse-settings/mouse-dialog.glade | ||
| 108 | @@ -323,7 +323,7 @@ | ||
| 109 | <property name="visible">True</property> | ||
| 110 | <property name="can_focus">False</property> | ||
| 111 | <property name="border_width">6</property> | ||
| 112 | - <property name="n_rows">3</property> | ||
| 113 | + <property name="n_rows">4</property> | ||
| 114 | <property name="n_columns">2</property> | ||
| 115 | <property name="column_spacing">12</property> | ||
| 116 | <property name="row_spacing">6</property> | ||
| 117 | @@ -415,6 +415,32 @@ | ||
| 118 | <property name="bottom_attach">3</property> | ||
| 119 | </packing> | ||
| 120 | </child> | ||
| 121 | + <child> | ||
| 122 | + <object class="GtkAlignment" id="alignment9"> | ||
| 123 | + <property name="visible">True</property> | ||
| 124 | + <property name="can_focus">False</property> | ||
| 125 | + <property name="xalign">0</property> | ||
| 126 | + <property name="xscale">0</property> | ||
| 127 | + <property name="yscale">0</property> | ||
| 128 | + <child> | ||
| 129 | + <object class="GtkCheckButton" id="touchscreen-pointer"> | ||
| 130 | + <property name="label" translatable="yes">_Touchscreen pointer</property> | ||
| 131 | + <property name="use_action_appearance">False</property> | ||
| 132 | + <property name="visible">True</property> | ||
| 133 | + <property name="can_focus">True</property> | ||
| 134 | + <property name="receives_default">False</property> | ||
| 135 | + <property name="tooltip_text" translatable="yes">When selected, no mouse pointer is displayed for this device and gtk TouchscreenMode is activated</property> | ||
| 136 | + <property name="use_underline">True</property> | ||
| 137 | + <property name="draw_indicator">True</property> | ||
| 138 | + </object> | ||
| 139 | + </child> | ||
| 140 | + </object> | ||
| 141 | + <packing> | ||
| 142 | + <property name="right_attach">2</property> | ||
| 143 | + <property name="top_attach">3</property> | ||
| 144 | + <property name="bottom_attach">4</property> | ||
| 145 | + </packing> | ||
| 146 | + </child> | ||
| 147 | </object> | ||
| 148 | </child> | ||
| 149 | </object> | ||
| 150 | -- | ||
| 151 | 1.7.6.5 | ||
| 152 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0003-XfcePointersHelper-gets-a-pointer-to-XfceXSettingsHe.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0003-XfcePointersHelper-gets-a-pointer-to-XfceXSettingsHe.patch deleted file mode 100644 index eff052b68f..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0003-XfcePointersHelper-gets-a-pointer-to-XfceXSettingsHe.patch +++ /dev/null | |||
| @@ -1,137 +0,0 @@ | |||
| 1 | From a3b0218137c8796fbb7bd6d852dc8ab5895a65cb Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Sat, 3 Nov 2012 18:32:01 +0100 | ||
| 4 | Subject: [PATCH 3/5] XfcePointersHelper gets a pointer to XfceXSettingsHelper | ||
| 5 | MIME-Version: 1.0 | ||
| 6 | Content-Type: text/plain; charset=UTF-8 | ||
| 7 | Content-Transfer-Encoding: 8bit | ||
| 8 | |||
| 9 | |||
| 10 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 11 | Upstream-Status: Submitted [1] | ||
| 12 | [1] https://bugzilla.xfce.org/show_bug.cgi?id=9474 | ||
| 13 | --- | ||
| 14 | xfsettingsd/main.c | 2 +- | ||
| 15 | xfsettingsd/pointers.c | 55 ++++++++++++++++++++++++++++++++++++++++++++++++ | ||
| 16 | 2 files changed, 56 insertions(+), 1 deletions(-) | ||
| 17 | |||
| 18 | diff --git a/xfsettingsd/main.c b/xfsettingsd/main.c | ||
| 19 | index 55c4183..99982f7 100644 | ||
| 20 | --- a/xfsettingsd/main.c | ||
| 21 | +++ b/xfsettingsd/main.c | ||
| 22 | @@ -273,7 +273,7 @@ main (gint argc, gchar **argv) | ||
| 23 | #ifdef HAVE_XRANDR | ||
| 24 | displays_helper = g_object_new (XFCE_TYPE_DISPLAYS_HELPER, NULL); | ||
| 25 | #endif | ||
| 26 | - pointer_helper = g_object_new (XFCE_TYPE_POINTERS_HELPER, NULL); | ||
| 27 | + pointer_helper = g_object_new (XFCE_TYPE_POINTERS_HELPER, "xsettings-helper", xsettings_helper, NULL); | ||
| 28 | keyboards_helper = g_object_new (XFCE_TYPE_KEYBOARDS_HELPER, NULL); | ||
| 29 | accessibility_helper = g_object_new (XFCE_TYPE_ACCESSIBILITY_HELPER, NULL); | ||
| 30 | shortcuts_helper = g_object_new (XFCE_TYPE_KEYBOARD_SHORTCUTS_HELPER, NULL); | ||
| 31 | diff --git a/xfsettingsd/pointers.c b/xfsettingsd/pointers.c | ||
| 32 | index e7192e7..62ebc60 100644 | ||
| 33 | --- a/xfsettingsd/pointers.c | ||
| 34 | +++ b/xfsettingsd/pointers.c | ||
| 35 | @@ -47,8 +47,16 @@ | ||
| 36 | |||
| 37 | #define XFCONF_TYPE_G_VALUE_ARRAY (dbus_g_type_get_collection ("GPtrArray", G_TYPE_VALUE)) | ||
| 38 | |||
| 39 | +/* Property identifiers */ | ||
| 40 | +enum | ||
| 41 | +{ | ||
| 42 | + PROP_0, | ||
| 43 | + PROP_XSETTINGS_HELPER, | ||
| 44 | +}; | ||
| 45 | + | ||
| 46 | |||
| 47 | |||
| 48 | +static void xfce_pointers_helper_constructed (GObject *object); | ||
| 49 | static void xfce_pointers_helper_finalize (GObject *object); | ||
| 50 | static void xfce_pointers_helper_syndaemon_stop (XfcePointersHelper *helper); | ||
| 51 | static void xfce_pointers_helper_syndaemon_check (XfcePointersHelper *helper); | ||
| 52 | @@ -63,6 +71,10 @@ static GdkFilterReturn xfce_pointers_helper_event_filter (GdkXEvent | ||
| 53 | GdkEvent *gdk_event, | ||
| 54 | gpointer user_data); | ||
| 55 | #endif | ||
| 56 | +static void xfce_pointers_helper_set_property (GObject *object, | ||
| 57 | + guint prop_id, | ||
| 58 | + const GValue *value, | ||
| 59 | + GParamSpec *pspec); | ||
| 60 | |||
| 61 | |||
| 62 | |||
| 63 | @@ -75,6 +87,8 @@ struct _XfcePointersHelper | ||
| 64 | { | ||
| 65 | GObject __parent__; | ||
| 66 | |||
| 67 | + GObject *xsettings_helper; | ||
| 68 | + | ||
| 69 | /* xfconf channel */ | ||
| 70 | XfconfChannel *channel; | ||
| 71 | |||
| 72 | @@ -108,7 +122,18 @@ xfce_pointers_helper_class_init (XfcePointersHelperClass *klass) | ||
| 73 | { | ||
| 74 | GObjectClass *gobject_class = G_OBJECT_CLASS (klass); | ||
| 75 | |||
| 76 | + gobject_class->constructed = xfce_pointers_helper_constructed; | ||
| 77 | gobject_class->finalize = xfce_pointers_helper_finalize; | ||
| 78 | + gobject_class->set_property = xfce_pointers_helper_set_property; | ||
| 79 | + | ||
| 80 | + g_object_class_install_property (gobject_class, | ||
| 81 | + PROP_XSETTINGS_HELPER, | ||
| 82 | + g_param_spec_object ("xsettings-helper", | ||
| 83 | + "xsettings-helper", | ||
| 84 | + "xsettings-helper", | ||
| 85 | + G_TYPE_OBJECT, | ||
| 86 | + G_PARAM_CONSTRUCT_ONLY | | ||
| 87 | + G_PARAM_WRITABLE)); | ||
| 88 | } | ||
| 89 | |||
| 90 | |||
| 91 | @@ -116,6 +141,15 @@ xfce_pointers_helper_class_init (XfcePointersHelperClass *klass) | ||
| 92 | static void | ||
| 93 | xfce_pointers_helper_init (XfcePointersHelper *helper) | ||
| 94 | { | ||
| 95 | + /* All initialisation is done at xfce_pointers_helper_constructed */ | ||
| 96 | +} | ||
| 97 | + | ||
| 98 | + | ||
| 99 | + | ||
| 100 | +static void | ||
| 101 | +xfce_pointers_helper_constructed (GObject *object) | ||
| 102 | +{ | ||
| 103 | + XfcePointersHelper *helper = XFCE_POINTERS_HELPER (object); | ||
| 104 | XExtensionVersion *version = NULL; | ||
| 105 | Display *xdisplay; | ||
| 106 | #ifdef DEVICE_HOTPLUGGING | ||
| 107 | @@ -181,6 +215,27 @@ xfce_pointers_helper_init (XfcePointersHelper *helper) | ||
| 108 | |||
| 109 | |||
| 110 | static void | ||
| 111 | +xfce_pointers_helper_set_property (GObject *object, | ||
| 112 | + guint prop_id, | ||
| 113 | + const GValue *value, | ||
| 114 | + GParamSpec *pspec) | ||
| 115 | +{ | ||
| 116 | + XfcePointersHelper *helper = XFCE_POINTERS_HELPER (object); | ||
| 117 | + | ||
| 118 | + switch (prop_id) | ||
| 119 | + { | ||
| 120 | + case PROP_XSETTINGS_HELPER: | ||
| 121 | + helper->xsettings_helper = g_value_get_object (value); | ||
| 122 | + break; | ||
| 123 | + default: | ||
| 124 | + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
| 125 | + break; | ||
| 126 | + } | ||
| 127 | +} | ||
| 128 | + | ||
| 129 | + | ||
| 130 | + | ||
| 131 | +static void | ||
| 132 | xfce_pointers_helper_finalize (GObject *object) | ||
| 133 | { | ||
| 134 | xfce_pointers_helper_syndaemon_stop (XFCE_POINTERS_HELPER (object)); | ||
| 135 | -- | ||
| 136 | 1.7.6.5 | ||
| 137 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0004-XfceXSettingsHelper-gets-a-property-touchscreen-poin.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0004-XfceXSettingsHelper-gets-a-property-touchscreen-poin.patch deleted file mode 100644 index cacb5c3a13..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0004-XfceXSettingsHelper-gets-a-property-touchscreen-poin.patch +++ /dev/null | |||
| @@ -1,249 +0,0 @@ | |||
| 1 | From 878fe1287a4c73f67dd2b51d1d7c450097aeffa7 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Thu, 20 Dec 2012 16:49:18 +0100 | ||
| 4 | Subject: [PATCH 4/5] XfceXSettingsHelper gets a property | ||
| 5 | "touchscreen-pointer" | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | When this property is set, it overrides overrides cursor theme to | ||
| 11 | "xfce-invisible" and sets /Gtk/TouchscreenMode. | ||
| 12 | |||
| 13 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 14 | Upstream-Status: Submitted [1] | ||
| 15 | [1] https://bugzilla.xfce.org/show_bug.cgi?id=9474 | ||
| 16 | --- | ||
| 17 | xfsettingsd/xsettings.c | 122 ++++++++++++++++++++++++++++++++++++++++++++- | ||
| 18 | xfsettingsd/xsettings.xml | 1 + | ||
| 19 | 2 files changed, 122 insertions(+), 1 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/xfsettingsd/xsettings.c b/xfsettingsd/xsettings.c | ||
| 22 | index 7657465..76bcea1 100644 | ||
| 23 | --- a/xfsettingsd/xsettings.c | ||
| 24 | +++ b/xfsettingsd/xsettings.c | ||
| 25 | @@ -73,6 +73,15 @@ typedef struct _XfceXSettingsNotify XfceXSettingsNotify; | ||
| 26 | |||
| 27 | |||
| 28 | |||
| 29 | +/* Property identifiers */ | ||
| 30 | +enum | ||
| 31 | +{ | ||
| 32 | + PROP_0, | ||
| 33 | + PROP_TOUCHSCREEN_POINTER, | ||
| 34 | +}; | ||
| 35 | + | ||
| 36 | + | ||
| 37 | + | ||
| 38 | static void xfce_xsettings_helper_finalize (GObject *object); | ||
| 39 | static void xfce_xsettings_helper_fc_free (XfceXSettingsHelper *helper); | ||
| 40 | static gboolean xfce_xsettings_helper_fc_init (gpointer data); | ||
| 41 | @@ -86,6 +95,10 @@ static void xfce_xsettings_helper_load (XfceXSettingsHelper *helper) | ||
| 42 | static void xfce_xsettings_helper_screen_free (XfceXSettingsScreen *screen); | ||
| 43 | static void xfce_xsettings_helper_notify_xft (XfceXSettingsHelper *helper); | ||
| 44 | static void xfce_xsettings_helper_notify (XfceXSettingsHelper *helper); | ||
| 45 | +static void xfce_xsettings_helper_set_property (GObject *object, | ||
| 46 | + guint prop_id, | ||
| 47 | + const GValue *value, | ||
| 48 | + GParamSpec *pspec); | ||
| 49 | |||
| 50 | |||
| 51 | |||
| 52 | @@ -120,6 +133,13 @@ struct _XfceXSettingsHelper | ||
| 53 | GPtrArray *fc_monitors; | ||
| 54 | guint fc_notify_timeout_id; | ||
| 55 | guint fc_init_id; | ||
| 56 | + | ||
| 57 | + /* keeper for touchscreen cursor theme / last set */ | ||
| 58 | + GValue *touchscreen_cursor_value; | ||
| 59 | + GValue *lastset_cursor_value; | ||
| 60 | + | ||
| 61 | + /* properties */ | ||
| 62 | + gboolean touchscreen_pointer; | ||
| 63 | }; | ||
| 64 | |||
| 65 | struct _XfceXSetting | ||
| 66 | @@ -157,6 +177,16 @@ xfce_xsettings_helper_class_init (XfceXSettingsHelperClass *klass) | ||
| 67 | |||
| 68 | gobject_class = G_OBJECT_CLASS (klass); | ||
| 69 | gobject_class->finalize = xfce_xsettings_helper_finalize; | ||
| 70 | + gobject_class->set_property = xfce_xsettings_helper_set_property; | ||
| 71 | + | ||
| 72 | + g_object_class_install_property (gobject_class, | ||
| 73 | + PROP_TOUCHSCREEN_POINTER, | ||
| 74 | + g_param_spec_boolean ("touchscreen-pointer", | ||
| 75 | + "touchscreen-pointer", | ||
| 76 | + "touchscreen-pointer", | ||
| 77 | + FALSE, | ||
| 78 | + G_PARAM_WRITABLE | | ||
| 79 | + G_PARAM_STATIC_STRINGS)); | ||
| 80 | } | ||
| 81 | |||
| 82 | |||
| 83 | @@ -169,6 +199,13 @@ xfce_xsettings_helper_init (XfceXSettingsHelper *helper) | ||
| 84 | helper->settings = g_hash_table_new_full (g_str_hash, g_str_equal, | ||
| 85 | g_free, xfce_xsettings_helper_setting_free); | ||
| 86 | |||
| 87 | + helper->lastset_cursor_value = g_new0 (GValue, 1); | ||
| 88 | + g_value_init(helper->lastset_cursor_value, G_TYPE_STRING); | ||
| 89 | + g_value_set_string (helper->lastset_cursor_value, "default"); | ||
| 90 | + helper->touchscreen_cursor_value = g_new0 (GValue, 1); | ||
| 91 | + g_value_init(helper->touchscreen_cursor_value, G_TYPE_STRING); | ||
| 92 | + g_value_set_string (helper->touchscreen_cursor_value, "xfce-invisible"); | ||
| 93 | + | ||
| 94 | xfce_xsettings_helper_load (helper); | ||
| 95 | |||
| 96 | g_signal_connect (G_OBJECT (helper->channel), "property-changed", | ||
| 97 | @@ -202,6 +239,9 @@ xfce_xsettings_helper_finalize (GObject *object) | ||
| 98 | |||
| 99 | g_hash_table_destroy (helper->settings); | ||
| 100 | |||
| 101 | + g_free (helper->lastset_cursor_value); | ||
| 102 | + g_free (helper->touchscreen_cursor_value); | ||
| 103 | + | ||
| 104 | (*G_OBJECT_CLASS (xfce_xsettings_helper_parent_class)->finalize) (object); | ||
| 105 | } | ||
| 106 | |||
| 107 | @@ -387,6 +427,61 @@ xfce_xsettings_helper_notify_xft_idle (gpointer data) | ||
| 108 | |||
| 109 | |||
| 110 | |||
| 111 | +static void | ||
| 112 | +xfce_xsettings_helper_set_property (GObject *object, | ||
| 113 | + guint prop_id, | ||
| 114 | + const GValue *value, | ||
| 115 | + GParamSpec *pspec) | ||
| 116 | +{ | ||
| 117 | + gboolean touchscreen_pointer; | ||
| 118 | + XfceXSetting *setting_theme, *setting_touchscreen; | ||
| 119 | + XfceXSettingsHelper *helper = XFCE_XSETTINGS_HELPER (object); | ||
| 120 | + GtkSettings *gtk_settings; | ||
| 121 | + GValue bool_val = { 0, }; | ||
| 122 | + | ||
| 123 | + switch (prop_id) | ||
| 124 | + { | ||
| 125 | + case PROP_TOUCHSCREEN_POINTER: | ||
| 126 | + touchscreen_pointer = g_value_get_boolean (value); | ||
| 127 | + if (helper->touchscreen_pointer != touchscreen_pointer) | ||
| 128 | + { | ||
| 129 | + helper->touchscreen_pointer = touchscreen_pointer; | ||
| 130 | + /* Update touchscreen-mode */ | ||
| 131 | + xfconf_channel_set_bool (helper->channel, "/Gtk/TouchscreenMode", touchscreen_pointer); | ||
| 132 | + /* Update cursor */ | ||
| 133 | + setting_theme = g_hash_table_lookup (helper->settings, "/Gtk/CursorThemeName"); | ||
| 134 | + if (G_LIKELY (setting_theme != NULL)) | ||
| 135 | + { | ||
| 136 | + /* update the serial */ | ||
| 137 | + setting_theme->last_change_serial = helper->serial; | ||
| 138 | + /* update value */ | ||
| 139 | + g_value_reset (setting_theme->value); | ||
| 140 | + g_value_copy (touchscreen_pointer ? | ||
| 141 | + helper->touchscreen_cursor_value : | ||
| 142 | + helper->lastset_cursor_value, | ||
| 143 | + setting_theme->value); | ||
| 144 | + } | ||
| 145 | + else | ||
| 146 | + g_critical("Setting not found for /Gtk/CursorThemeName"); | ||
| 147 | + | ||
| 148 | + if (G_LIKELY (setting_touchscreen != NULL || setting_theme != NULL)) | ||
| 149 | + { | ||
| 150 | + /* schedule xsettings update */ | ||
| 151 | + if (helper->notify_idle_id == 0) | ||
| 152 | + helper->notify_idle_id = g_idle_add (xfce_xsettings_helper_notify_idle, helper); | ||
| 153 | + if (helper->notify_xft_idle_id == 0) | ||
| 154 | + helper->notify_xft_idle_id = g_idle_add (xfce_xsettings_helper_notify_xft_idle, helper); | ||
| 155 | + } | ||
| 156 | + } | ||
| 157 | + break; | ||
| 158 | + default: | ||
| 159 | + G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); | ||
| 160 | + break; | ||
| 161 | + } | ||
| 162 | +} | ||
| 163 | + | ||
| 164 | + | ||
| 165 | + | ||
| 166 | static gboolean | ||
| 167 | xfce_xsettings_helper_prop_valid (const gchar *prop_name, | ||
| 168 | const GValue *value) | ||
| 169 | @@ -413,6 +508,28 @@ xfce_xsettings_helper_prop_valid (const gchar *prop_name, | ||
| 170 | |||
| 171 | |||
| 172 | |||
| 173 | +static void | ||
| 174 | +xfce_xsettings_helper_check_cursor (const gchar *prop_name, | ||
| 175 | + GValue *value, | ||
| 176 | + XfceXSettingsHelper *helper) | ||
| 177 | +{ | ||
| 178 | + if (g_strcmp0 (prop_name, "/Gtk/CursorThemeName") == 0) | ||
| 179 | + { | ||
| 180 | + /* Keep last cursor theme set */ | ||
| 181 | + g_value_reset (helper->lastset_cursor_value); | ||
| 182 | + g_value_copy (value, helper->lastset_cursor_value); | ||
| 183 | + | ||
| 184 | + /* invisible replacement required ? */ | ||
| 185 | + if (helper->touchscreen_pointer) | ||
| 186 | + { | ||
| 187 | + g_value_reset (value); | ||
| 188 | + g_value_copy (helper->touchscreen_cursor_value, value); | ||
| 189 | + } | ||
| 190 | + } | ||
| 191 | +} | ||
| 192 | + | ||
| 193 | + | ||
| 194 | + | ||
| 195 | static gboolean | ||
| 196 | xfce_xsettings_helper_prop_load (gchar *prop_name, | ||
| 197 | GValue *value, | ||
| 198 | @@ -426,6 +543,7 @@ xfce_xsettings_helper_prop_load (gchar *prop_name, | ||
| 199 | |||
| 200 | setting = g_slice_new0 (XfceXSetting); | ||
| 201 | setting->value = value; | ||
| 202 | + xfce_xsettings_helper_check_cursor (prop_name, setting->value, helper); | ||
| 203 | setting->last_change_serial = helper->serial; | ||
| 204 | |||
| 205 | xfsettings_dbg_filtered (XFSD_DEBUG_XSETTINGS, "prop \"%s\" loaded (type=%s)", | ||
| 206 | @@ -462,6 +580,7 @@ xfce_xsettings_helper_prop_changed (XfconfChannel *channel, | ||
| 207 | * it first */ | ||
| 208 | g_value_reset (setting->value); | ||
| 209 | g_value_copy (value, setting->value); | ||
| 210 | + xfce_xsettings_helper_check_cursor (prop_name, setting->value, helper); | ||
| 211 | |||
| 212 | /* update the serial */ | ||
| 213 | setting->last_change_serial = helper->serial; | ||
| 214 | @@ -475,6 +594,7 @@ xfce_xsettings_helper_prop_changed (XfconfChannel *channel, | ||
| 215 | |||
| 216 | g_value_init (setting->value, G_VALUE_TYPE (value)); | ||
| 217 | g_value_copy (value, setting->value); | ||
| 218 | + xfce_xsettings_helper_check_cursor (prop_name, setting->value, helper); | ||
| 219 | |||
| 220 | g_hash_table_insert (helper->settings, g_strdup (prop_name), setting); | ||
| 221 | } | ||
| 222 | @@ -649,6 +769,7 @@ xfce_xsettings_helper_notify_xft (XfceXSettingsHelper *helper) | ||
| 223 | XfceXSetting *setting; | ||
| 224 | guint i; | ||
| 225 | GValue bool_val = { 0, }; | ||
| 226 | + | ||
| 227 | const gchar *props[][2] = | ||
| 228 | { | ||
| 229 | /* { xfconf name}, { xft name } */ | ||
| 230 | @@ -700,7 +821,6 @@ xfce_xsettings_helper_notify_xft (XfceXSettingsHelper *helper) | ||
| 231 | PropModeReplace, | ||
| 232 | (guchar *) resource->str, | ||
| 233 | resource->len); | ||
| 234 | - | ||
| 235 | XCloseDisplay (xdisplay); | ||
| 236 | |||
| 237 | if (gdk_error_trap_pop () != 0) | ||
| 238 | --- a/xfsettingsd/xsettings.xml | ||
| 239 | +++ b/xfsettingsd/xsettings.xml | ||
| 240 | @@ -36,5 +36,6 @@ | ||
| 241 | <property name="MenuBarAccel" type="string" value="F10"/> | ||
| 242 | <property name="CursorThemeName" type="string" value=""/> | ||
| 243 | <property name="CursorThemeSize" type="int" value="0"/> | ||
| 244 | + <property name="TouchscreenMode" type="bool" value="false"/> | ||
| 245 | </property> | ||
| 246 | </channel> | ||
| 247 | -- | ||
| 248 | 1.7.6.5 | ||
| 249 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0005-pointers-detect-a-change-of-pointer-device-used-and-.patch b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0005-pointers-detect-a-change-of-pointer-device-used-and-.patch deleted file mode 100644 index 3c9b3dad9b..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/0005-pointers-detect-a-change-of-pointer-device-used-and-.patch +++ /dev/null | |||
| @@ -1,589 +0,0 @@ | |||
| 1 | From 78353322ce1070ee1fd7bb5367e2c4dd43928f42 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: =?UTF-8?q?Andreas=20M=C3=BCller?= <schnitzeltony@googlemail.com> | ||
| 3 | Date: Thu, 20 Dec 2012 16:58:19 +0100 | ||
| 4 | Subject: [PATCH 5/5] pointers: detect a change of pointer-device used and set | ||
| 5 | "touchscreen-pointer" as found in xfconf | ||
| 6 | MIME-Version: 1.0 | ||
| 7 | Content-Type: text/plain; charset=UTF-8 | ||
| 8 | Content-Transfer-Encoding: 8bit | ||
| 9 | |||
| 10 | To detect pointer device in use the DevicePresence-, DeviceMotionNotify- and | ||
| 11 | DeviceButtonPress-events are handled. Tests showed that by repopenning and | ||
| 12 | closing the pointer devices (e.g when another setting was modified), the events | ||
| 13 | stopped working. Therefore all pointer devices are opened only once and managed | ||
| 14 | in a hash table. | ||
| 15 | |||
| 16 | Signed-off-by: Andreas Müller <schnitzeltony@googlemail.com> | ||
| 17 | Upstream-Status: Submitted [1] | ||
| 18 | [1] https://bugzilla.xfce.org/show_bug.cgi?id=9474 | ||
| 19 | --- | ||
| 20 | xfsettingsd/pointers.c | 342 ++++++++++++++++++++++++++++++++----------------- | ||
| 21 | 1 file changed, 225 insertions(+), 117 deletions(-) | ||
| 22 | |||
| 23 | diff --git a/xfsettingsd/pointers.c b/xfsettingsd/pointers.c | ||
| 24 | index cfa56e2..41c8bba 100644 | ||
| 25 | --- a/xfsettingsd/pointers.c | ||
| 26 | +++ b/xfsettingsd/pointers.c | ||
| 27 | @@ -66,11 +66,9 @@ static void xfce_pointers_helper_channel_property_changed (XfconfCha | ||
| 28 | const gchar *property_name, | ||
| 29 | const GValue *value, | ||
| 30 | XfcePointersHelper *helper); | ||
| 31 | -#ifdef DEVICE_HOTPLUGGING | ||
| 32 | static GdkFilterReturn xfce_pointers_helper_event_filter (GdkXEvent *xevent, | ||
| 33 | GdkEvent *gdk_event, | ||
| 34 | gpointer user_data); | ||
| 35 | -#endif | ||
| 36 | static void xfce_pointers_helper_set_property (GObject *object, | ||
| 37 | guint prop_id, | ||
| 38 | const GValue *value, | ||
| 39 | @@ -96,8 +94,11 @@ struct _XfcePointersHelper | ||
| 40 | GPid syndaemon_pid; | ||
| 41 | #endif | ||
| 42 | |||
| 43 | + GHashTable *pointer_devices; | ||
| 44 | + XID last_pointer_active; | ||
| 45 | + gint device_motion_event_type; | ||
| 46 | + gint device_button_press_event_type; | ||
| 47 | #ifdef DEVICE_HOTPLUGGING | ||
| 48 | - /* device presence event type */ | ||
| 49 | gint device_presence_event_type; | ||
| 50 | #endif | ||
| 51 | }; | ||
| 52 | @@ -117,6 +118,15 @@ G_DEFINE_TYPE (XfcePointersHelper, xfce_pointers_helper, G_TYPE_OBJECT); | ||
| 53 | |||
| 54 | |||
| 55 | |||
| 56 | +typedef struct | ||
| 57 | +{ | ||
| 58 | + XDevice *device; | ||
| 59 | + gchar* name; | ||
| 60 | +} | ||
| 61 | +XfcePointerDeviceData; | ||
| 62 | + | ||
| 63 | + | ||
| 64 | + | ||
| 65 | static void | ||
| 66 | xfce_pointers_helper_class_init (XfcePointersHelperClass *klass) | ||
| 67 | { | ||
| 68 | @@ -147,6 +157,18 @@ xfce_pointers_helper_init (XfcePointersHelper *helper) | ||
| 69 | |||
| 70 | |||
| 71 | static void | ||
| 72 | +xfce_pointers_device_close (gpointer data) | ||
| 73 | +{ | ||
| 74 | + XfcePointerDeviceData *device_data = data; | ||
| 75 | + | ||
| 76 | + XCloseDevice (GDK_DISPLAY (), device_data->device); | ||
| 77 | + g_free (device_data->name); | ||
| 78 | + g_free (device_data); | ||
| 79 | +} | ||
| 80 | + | ||
| 81 | + | ||
| 82 | + | ||
| 83 | +static void | ||
| 84 | xfce_pointers_helper_constructed (GObject *object) | ||
| 85 | { | ||
| 86 | XfcePointersHelper *helper = XFCE_POINTERS_HELPER (object); | ||
| 87 | @@ -185,6 +207,10 @@ xfce_pointers_helper_constructed (GObject *object) | ||
| 88 | helper->channel = xfconf_channel_get ("pointers"); | ||
| 89 | |||
| 90 | /* restore the pointer devices */ | ||
| 91 | + helper->pointer_devices = g_hash_table_new_full (g_int_hash, | ||
| 92 | + g_int_equal, | ||
| 93 | + g_free, | ||
| 94 | + xfce_pointers_device_close); | ||
| 95 | xfce_pointers_helper_restore_devices (helper, NULL); | ||
| 96 | |||
| 97 | /* monitor the channel */ | ||
| 98 | @@ -194,21 +220,20 @@ xfce_pointers_helper_constructed (GObject *object) | ||
| 99 | /* launch syndaemon if required */ | ||
| 100 | xfce_pointers_helper_syndaemon_check (helper); | ||
| 101 | |||
| 102 | -#ifdef DEVICE_HOTPLUGGING | ||
| 103 | if (G_LIKELY (xdisplay != NULL)) | ||
| 104 | { | ||
| 105 | +#ifdef DEVICE_HOTPLUGGING | ||
| 106 | /* monitor device changes */ | ||
| 107 | gdk_error_trap_push (); | ||
| 108 | DevicePresence (xdisplay, helper->device_presence_event_type, event_class); | ||
| 109 | XSelectExtensionEvent (xdisplay, RootWindow (xdisplay, DefaultScreen (xdisplay)), &event_class, 1); | ||
| 110 | |||
| 111 | /* add an event filter */ | ||
| 112 | - if (gdk_error_trap_pop () == 0) | ||
| 113 | - gdk_window_add_filter (NULL, xfce_pointers_helper_event_filter, helper); | ||
| 114 | - else | ||
| 115 | + if (gdk_error_trap_pop () != 0) | ||
| 116 | g_warning ("Failed to create device filter"); | ||
| 117 | - } | ||
| 118 | #endif | ||
| 119 | + gdk_window_add_filter (NULL, xfce_pointers_helper_event_filter, helper); | ||
| 120 | + } | ||
| 121 | } | ||
| 122 | } | ||
| 123 | |||
| 124 | @@ -238,7 +263,10 @@ xfce_pointers_helper_set_property (GObject *object, | ||
| 125 | static void | ||
| 126 | xfce_pointers_helper_finalize (GObject *object) | ||
| 127 | { | ||
| 128 | - xfce_pointers_helper_syndaemon_stop (XFCE_POINTERS_HELPER (object)); | ||
| 129 | + XfcePointersHelper* helper = XFCE_POINTERS_HELPER (object); | ||
| 130 | + | ||
| 131 | + xfce_pointers_helper_syndaemon_stop (helper); | ||
| 132 | + g_hash_table_destroy (helper->pointer_devices); | ||
| 133 | |||
| 134 | (*G_OBJECT_CLASS (xfce_pointers_helper_parent_class)->finalize) (object); | ||
| 135 | } | ||
| 136 | @@ -267,19 +295,19 @@ static void | ||
| 137 | xfce_pointers_helper_syndaemon_check (XfcePointersHelper *helper) | ||
| 138 | { | ||
| 139 | #ifdef DEVICE_PROPERTIES | ||
| 140 | - Display *xdisplay = GDK_DISPLAY (); | ||
| 141 | - XDeviceInfo *device_list; | ||
| 142 | - XDevice *device; | ||
| 143 | - gint n, ndevices; | ||
| 144 | - Atom touchpad_type; | ||
| 145 | - Atom touchpad_off_prop; | ||
| 146 | - Atom *props; | ||
| 147 | - gint i, nprops; | ||
| 148 | - gboolean have_synaptics = FALSE; | ||
| 149 | - gdouble disable_duration; | ||
| 150 | - gchar disable_duration_string[64]; | ||
| 151 | - gchar *args[] = { "syndaemon", "-i", disable_duration_string, "-K", "-R", NULL }; | ||
| 152 | - GError *error = NULL; | ||
| 153 | + Display *xdisplay = GDK_DISPLAY (); | ||
| 154 | + XDeviceInfo *device_list; | ||
| 155 | + XfcePointerDeviceData *device_data; | ||
| 156 | + gint n, ndevices; | ||
| 157 | + Atom touchpad_type; | ||
| 158 | + Atom touchpad_off_prop; | ||
| 159 | + Atom *props; | ||
| 160 | + gint i, nprops; | ||
| 161 | + gboolean have_synaptics = FALSE; | ||
| 162 | + gdouble disable_duration; | ||
| 163 | + gchar disable_duration_string[64]; | ||
| 164 | + gchar *args[] = { "syndaemon", "-i", disable_duration_string, "-K", "-R", NULL }; | ||
| 165 | + GError *error = NULL; | ||
| 166 | |||
| 167 | /* only stop a running daemon */ | ||
| 168 | if (!xfconf_channel_get_bool (helper->channel, "/DisableTouchpadWhileTyping", FALSE)) | ||
| 169 | @@ -299,17 +327,16 @@ xfce_pointers_helper_syndaemon_check (XfcePointersHelper *helper) | ||
| 170 | if (device_list[n].type != touchpad_type) | ||
| 171 | continue; | ||
| 172 | |||
| 173 | - gdk_error_trap_push (); | ||
| 174 | - device = XOpenDevice (xdisplay, device_list[n].id); | ||
| 175 | - if (gdk_error_trap_pop () != 0 || device == NULL) | ||
| 176 | + device_data = g_hash_table_lookup (helper->pointer_devices, &device_list[n].id); | ||
| 177 | + if (device_data == NULL) | ||
| 178 | { | ||
| 179 | - g_critical ("Unable to open device %s", device_list[n].name); | ||
| 180 | + g_critical ("xfce_pointers_helper_syndaemon_check: Unable to find device %s / ID %i in hash table", device_list[n].name, device_list[n].id); | ||
| 181 | break; | ||
| 182 | } | ||
| 183 | |||
| 184 | /* look for the Synaptics Off property */ | ||
| 185 | gdk_error_trap_push (); | ||
| 186 | - props = XListDeviceProperties (xdisplay, device, &nprops); | ||
| 187 | + props = XListDeviceProperties (xdisplay, device_data->device, &nprops); | ||
| 188 | if (gdk_error_trap_pop () == 0 | ||
| 189 | && props != NULL) | ||
| 190 | { | ||
| 191 | @@ -319,8 +346,6 @@ xfce_pointers_helper_syndaemon_check (XfcePointersHelper *helper) | ||
| 192 | XFree (props); | ||
| 193 | } | ||
| 194 | |||
| 195 | - XCloseDevice (xdisplay, device); | ||
| 196 | - | ||
| 197 | if (have_synaptics) | ||
| 198 | break; | ||
| 199 | } | ||
| 200 | @@ -847,24 +872,56 @@ xfce_pointers_helper_change_properties (gpointer key, | ||
| 201 | |||
| 202 | |||
| 203 | static void | ||
| 204 | +xfce_pointers_helper_change_current_device (XfcePointersHelper *helper, | ||
| 205 | + XID *xid) | ||
| 206 | +{ | ||
| 207 | + XfcePointerDeviceData *device_data; | ||
| 208 | + gchar* prop; | ||
| 209 | + GValue bool_val = { 0, }; | ||
| 210 | + | ||
| 211 | + helper->last_pointer_active = *xid; | ||
| 212 | + device_data = g_hash_table_lookup (helper->pointer_devices, xid); | ||
| 213 | + if (device_data == NULL) | ||
| 214 | + { | ||
| 215 | + g_critical ("Unable to find device ID %i in hash table", *xid); | ||
| 216 | + return; | ||
| 217 | + } | ||
| 218 | + if (G_LIKELY (G_IS_OBJECT (helper->xsettings_helper))) | ||
| 219 | + { | ||
| 220 | + prop = g_strconcat ("/", device_data->name, "/TouchscreenPointer", NULL); | ||
| 221 | + g_value_init (&bool_val, G_TYPE_BOOLEAN); | ||
| 222 | + g_value_set_boolean (&bool_val, | ||
| 223 | + xfconf_channel_get_bool (helper->channel, prop, FALSE)); | ||
| 224 | + g_object_set_property (helper->xsettings_helper, "touchscreen-pointer", &bool_val); | ||
| 225 | + g_value_unset (&bool_val); | ||
| 226 | + g_free (prop); | ||
| 227 | + } | ||
| 228 | + else | ||
| 229 | + g_critical ("xsettings_helper was not properly set"); | ||
| 230 | +} | ||
| 231 | + | ||
| 232 | + | ||
| 233 | +static void | ||
| 234 | xfce_pointers_helper_restore_devices (XfcePointersHelper *helper, | ||
| 235 | XID *xid) | ||
| 236 | { | ||
| 237 | - Display *xdisplay = GDK_DISPLAY (); | ||
| 238 | - XDeviceInfo *device_list, *device_info; | ||
| 239 | - gint n, ndevices; | ||
| 240 | - XDevice *device; | ||
| 241 | - gchar *device_name; | ||
| 242 | - gchar prop[256]; | ||
| 243 | - gboolean right_handed; | ||
| 244 | - gboolean reverse_scrolling; | ||
| 245 | - gint threshold; | ||
| 246 | - gdouble acceleration; | ||
| 247 | + Display *xdisplay = GDK_DISPLAY (); | ||
| 248 | + XDeviceInfo *device_list, *device_info; | ||
| 249 | + gint n, ndevices; | ||
| 250 | + XDevice *device; | ||
| 251 | + XfcePointerDeviceData *device_data; | ||
| 252 | + gchar *device_name; | ||
| 253 | + gchar prop[256]; | ||
| 254 | + gboolean right_handed; | ||
| 255 | + gboolean reverse_scrolling; | ||
| 256 | + gint threshold; | ||
| 257 | + gdouble acceleration; | ||
| 258 | + XEventClass event_classes[2]; | ||
| 259 | #ifdef DEVICE_PROPERTIES | ||
| 260 | - GHashTable *props; | ||
| 261 | - XfcePointerData pointer_data; | ||
| 262 | + GHashTable *props; | ||
| 263 | + XfcePointerData pointer_data; | ||
| 264 | #endif | ||
| 265 | - const gchar *mode; | ||
| 266 | + const gchar *mode; | ||
| 267 | |||
| 268 | gdk_error_trap_push (); | ||
| 269 | device_list = XListInputDevices (xdisplay, &ndevices); | ||
| 270 | @@ -874,86 +931,110 @@ xfce_pointers_helper_restore_devices (XfcePointersHelper *helper, | ||
| 271 | return; | ||
| 272 | } | ||
| 273 | |||
| 274 | + device_data = NULL; | ||
| 275 | for (n = 0; n < ndevices; n++) | ||
| 276 | { | ||
| 277 | - /* filter the pointer devices */ | ||
| 278 | + /* filter the physical pointer devices */ | ||
| 279 | device_info = &device_list[n]; | ||
| 280 | if (device_info->use != IsXExtensionPointer | ||
| 281 | - || device_info->name == NULL) | ||
| 282 | + || device_info->name == NULL | ||
| 283 | + || g_str_has_prefix (device_info->name, "Virtual core XTEST")) | ||
| 284 | continue; | ||
| 285 | |||
| 286 | /* filter out the device if one is set */ | ||
| 287 | if (xid != NULL && device_info->id != *xid) | ||
| 288 | continue; | ||
| 289 | |||
| 290 | - /* open the device */ | ||
| 291 | - gdk_error_trap_push (); | ||
| 292 | - device = XOpenDevice (xdisplay, device_info->id); | ||
| 293 | - if (gdk_error_trap_pop () != 0 || device == NULL) | ||
| 294 | + device_data = g_hash_table_lookup (helper->pointer_devices, &device_info->id); | ||
| 295 | + if (device_data == NULL) | ||
| 296 | { | ||
| 297 | - g_critical ("Unable to open device %s", device_info->name); | ||
| 298 | - continue; | ||
| 299 | - } | ||
| 300 | + /* open the device and insert to hash */ | ||
| 301 | + gdk_error_trap_push (); | ||
| 302 | + device = XOpenDevice (xdisplay, device_info->id); | ||
| 303 | + if (G_UNLIKELY(gdk_error_trap_pop () != 0 || device == NULL)) | ||
| 304 | + { | ||
| 305 | + g_critical ("Unable to open device %s / ID: %i", device_info->name, device_info->id); | ||
| 306 | + continue; | ||
| 307 | + } | ||
| 308 | |||
| 309 | - /* create a valid xfconf property name for the device */ | ||
| 310 | - device_name = xfce_pointers_helper_device_xfconf_name (device_info->name); | ||
| 311 | + /* create a valid xfconf property name for the device */ | ||
| 312 | + device_name = xfce_pointers_helper_device_xfconf_name (device_info->name); | ||
| 313 | |||
| 314 | - /* read buttonmap properties */ | ||
| 315 | - g_snprintf (prop, sizeof (prop), "/%s/RightHanded", device_name); | ||
| 316 | - right_handed = xfconf_channel_get_bool (helper->channel, prop, -1); | ||
| 317 | + /* add device to our list */ | ||
| 318 | + device_data = g_new (XfcePointerDeviceData, 1); | ||
| 319 | + device_data->device = device; | ||
| 320 | + device_data->name = device_name; | ||
| 321 | + g_hash_table_insert (helper->pointer_devices, g_memdup (&device_info->id, sizeof(device_info->id)), device_data); | ||
| 322 | |||
| 323 | - g_snprintf (prop, sizeof (prop), "/%s/ReverseScrolling", device_name); | ||
| 324 | - reverse_scrolling = xfconf_channel_get_bool (helper->channel, prop, -1); | ||
| 325 | + /* catch motion event / button-press for new device */ | ||
| 326 | + gdk_error_trap_push (); | ||
| 327 | + DeviceMotionNotify (device, helper->device_motion_event_type, event_classes[0]); | ||
| 328 | + DeviceButtonPress (device, helper->device_button_press_event_type, event_classes[1]); | ||
| 329 | + XSelectExtensionEvent (xdisplay, RootWindow (xdisplay, DefaultScreen (xdisplay)), event_classes, 2); | ||
| 330 | + if (G_UNLIKELY (gdk_error_trap_pop () != 0)) | ||
| 331 | + g_critical ("Unable to register DeviceButtonPress/DeviceMotionNotify for %i", device_info->id); | ||
| 332 | |||
| 333 | - if (right_handed != -1 || reverse_scrolling != -1) | ||
| 334 | - { | ||
| 335 | - xfce_pointers_helper_change_button_mapping (device_info, device, xdisplay, | ||
| 336 | + | ||
| 337 | + /* read buttonmap properties */ | ||
| 338 | + g_snprintf (prop, sizeof (prop), "/%s/RightHanded", device_name); | ||
| 339 | + right_handed = xfconf_channel_get_bool (helper->channel, prop, -1); | ||
| 340 | + | ||
| 341 | + g_snprintf (prop, sizeof (prop), "/%s/ReverseScrolling", device_name); | ||
| 342 | + reverse_scrolling = xfconf_channel_get_bool (helper->channel, prop, -1); | ||
| 343 | + | ||
| 344 | + if (right_handed != -1 || reverse_scrolling != -1) | ||
| 345 | + { | ||
| 346 | + xfce_pointers_helper_change_button_mapping (device_info, device, xdisplay, | ||
| 347 | right_handed, reverse_scrolling); | ||
| 348 | - } | ||
| 349 | + } | ||
| 350 | |||
| 351 | - /* read feedback settings */ | ||
| 352 | - g_snprintf (prop, sizeof (prop), "/%s/Threshold", device_name); | ||
| 353 | - threshold = xfconf_channel_get_int (helper->channel, prop, -1); | ||
| 354 | + /* read feedback settings */ | ||
| 355 | + g_snprintf (prop, sizeof (prop), "/%s/Threshold", device_name); | ||
| 356 | + threshold = xfconf_channel_get_int (helper->channel, prop, -1); | ||
| 357 | |||
| 358 | - g_snprintf (prop, sizeof (prop), "/%s/Acceleration", device_name); | ||
| 359 | - acceleration = xfconf_channel_get_double (helper->channel, prop, -1.00); | ||
| 360 | + g_snprintf (prop, sizeof (prop), "/%s/Acceleration", device_name); | ||
| 361 | + acceleration = xfconf_channel_get_double (helper->channel, prop, -1.00); | ||
| 362 | |||
| 363 | - if (threshold != -1 || acceleration != -1.00) | ||
| 364 | - { | ||
| 365 | - xfce_pointers_helper_change_feedback (device_info, device, xdisplay, | ||
| 366 | - threshold, acceleration); | ||
| 367 | - } | ||
| 368 | + if (threshold != -1 || acceleration != -1.00) | ||
| 369 | + { | ||
| 370 | + xfce_pointers_helper_change_feedback (device_info, device, xdisplay, | ||
| 371 | + threshold, acceleration); | ||
| 372 | + } | ||
| 373 | |||
| 374 | - /* read mode settings */ | ||
| 375 | - g_snprintf (prop, sizeof (prop), "/%s/Mode", device_name); | ||
| 376 | - mode = xfconf_channel_get_string (helper->channel, prop, NULL); | ||
| 377 | + /* read mode settings */ | ||
| 378 | + g_snprintf (prop, sizeof (prop), "/%s/Mode", device_name); | ||
| 379 | + mode = xfconf_channel_get_string (helper->channel, prop, NULL); | ||
| 380 | |||
| 381 | - if (mode != NULL) | ||
| 382 | - xfce_pointers_helper_change_mode (device_info, device, xdisplay, mode); | ||
| 383 | + if (mode != NULL) | ||
| 384 | + xfce_pointers_helper_change_mode (device_info, device, xdisplay, mode); | ||
| 385 | |||
| 386 | #ifdef DEVICE_PROPERTIES | ||
| 387 | - /* set device properties */ | ||
| 388 | - g_snprintf (prop, sizeof (prop), "/%s/Properties", device_name); | ||
| 389 | - props = xfconf_channel_get_properties (helper->channel, prop); | ||
| 390 | + /* set device properties */ | ||
| 391 | + g_snprintf (prop, sizeof (prop), "/%s/Properties", device_name); | ||
| 392 | + props = xfconf_channel_get_properties (helper->channel, prop); | ||
| 393 | |||
| 394 | - if (props != NULL) | ||
| 395 | - { | ||
| 396 | - pointer_data.xdisplay = xdisplay; | ||
| 397 | - pointer_data.device = device; | ||
| 398 | - pointer_data.device_info = device_info; | ||
| 399 | - pointer_data.prop_name_len = strlen (prop) + 1; | ||
| 400 | + if (props != NULL) | ||
| 401 | + { | ||
| 402 | + pointer_data.xdisplay = xdisplay; | ||
| 403 | + pointer_data.device = device; | ||
| 404 | + pointer_data.device_info = device_info; | ||
| 405 | + pointer_data.prop_name_len = strlen (prop) + 1; | ||
| 406 | |||
| 407 | - g_hash_table_foreach (props, xfce_pointers_helper_change_properties, &pointer_data); | ||
| 408 | + g_hash_table_foreach (props, xfce_pointers_helper_change_properties, &pointer_data); | ||
| 409 | |||
| 410 | - g_hash_table_destroy (props); | ||
| 411 | - } | ||
| 412 | + g_hash_table_destroy (props); | ||
| 413 | + } | ||
| 414 | #endif | ||
| 415 | - | ||
| 416 | - g_free (device_name); | ||
| 417 | - XCloseDevice (xdisplay, device); | ||
| 418 | + } | ||
| 419 | } | ||
| 420 | - | ||
| 421 | XFreeDeviceList (device_list); | ||
| 422 | + if (G_LIKELY (device_data != NULL)) | ||
| 423 | + { | ||
| 424 | + if (helper->last_pointer_active != device_data->device->device_id) | ||
| 425 | + xfce_pointers_helper_change_current_device (helper, &device_data->device->device_id); | ||
| 426 | + } | ||
| 427 | + else | ||
| 428 | + g_critical("no device selected in xfce_pointers_helper_restore_devices"); | ||
| 429 | } | ||
| 430 | |||
| 431 | |||
| 432 | @@ -964,12 +1045,12 @@ xfce_pointers_helper_channel_property_changed (XfconfChannel *channel, | ||
| 433 | const GValue *value, | ||
| 434 | XfcePointersHelper *helper) | ||
| 435 | { | ||
| 436 | - Display *xdisplay = GDK_DISPLAY (); | ||
| 437 | - XDeviceInfo *device_list, *device_info; | ||
| 438 | - XDevice *device; | ||
| 439 | - gint n, ndevices; | ||
| 440 | - gchar **names; | ||
| 441 | - gchar *device_name; | ||
| 442 | + Display *xdisplay = GDK_DISPLAY (); | ||
| 443 | + XDeviceInfo *device_list, *device_info; | ||
| 444 | + XfcePointerDeviceData *device_data; | ||
| 445 | + gint n, ndevices; | ||
| 446 | + gchar **names; | ||
| 447 | + gchar *device_name; | ||
| 448 | |||
| 449 | if (G_UNLIKELY (property_name == NULL)) | ||
| 450 | return; | ||
| 451 | @@ -1000,63 +1081,72 @@ xfce_pointers_helper_channel_property_changed (XfconfChannel *channel, | ||
| 452 | /* filter the pointer devices */ | ||
| 453 | device_info = &device_list[n]; | ||
| 454 | if (device_info->use != IsXExtensionPointer | ||
| 455 | - || device_info->name == NULL) | ||
| 456 | + || device_info->name == NULL | ||
| 457 | + || g_str_has_prefix (device_info->name, "Virtual core XTEST")) | ||
| 458 | continue; | ||
| 459 | |||
| 460 | /* search the device name */ | ||
| 461 | device_name = xfce_pointers_helper_device_xfconf_name (device_info->name); | ||
| 462 | if (strcmp (names[0], device_name) == 0) | ||
| 463 | { | ||
| 464 | - /* open the device */ | ||
| 465 | - gdk_error_trap_push (); | ||
| 466 | - device = XOpenDevice (xdisplay, device_info->id); | ||
| 467 | - if (gdk_error_trap_pop () != 0 || device == NULL) | ||
| 468 | + /* find the device */ | ||
| 469 | + device_data = g_hash_table_lookup (helper->pointer_devices, &device_info->id); | ||
| 470 | + if (device_data == NULL) | ||
| 471 | { | ||
| 472 | - g_critical ("Unable to open device %s", device_info->name); | ||
| 473 | + g_critical ("xfce_pointers_helper_channel_property_changed: Unable to find device %s / ID %i in hash table", device_info->name, device_info->id); | ||
| 474 | continue; | ||
| 475 | } | ||
| 476 | |||
| 477 | /* check the property that requires updating */ | ||
| 478 | if (strcmp (names[1], "RightHanded") == 0) | ||
| 479 | { | ||
| 480 | - xfce_pointers_helper_change_button_mapping (device_info, device, xdisplay, | ||
| 481 | + xfce_pointers_helper_change_button_mapping (device_info, device_data->device, xdisplay, | ||
| 482 | g_value_get_boolean (value), -1); | ||
| 483 | } | ||
| 484 | else if (strcmp (names[1], "ReverseScrolling") == 0) | ||
| 485 | { | ||
| 486 | - xfce_pointers_helper_change_button_mapping (device_info, device, xdisplay, | ||
| 487 | + xfce_pointers_helper_change_button_mapping (device_info, device_data->device, xdisplay, | ||
| 488 | -1, g_value_get_boolean (value)); | ||
| 489 | } | ||
| 490 | else if (strcmp (names[1], "Threshold") == 0) | ||
| 491 | { | ||
| 492 | - xfce_pointers_helper_change_feedback (device_info, device, xdisplay, | ||
| 493 | + xfce_pointers_helper_change_feedback (device_info, device_data->device, xdisplay, | ||
| 494 | g_value_get_int (value), -2.00); | ||
| 495 | } | ||
| 496 | else if (strcmp (names[1], "Acceleration") == 0) | ||
| 497 | { | ||
| 498 | - xfce_pointers_helper_change_feedback (device_info, device, xdisplay, | ||
| 499 | + xfce_pointers_helper_change_feedback (device_info, device_data->device, xdisplay, | ||
| 500 | -2, g_value_get_double (value)); | ||
| 501 | } | ||
| 502 | #ifdef DEVICE_PROPERTIES | ||
| 503 | else if (strcmp (names[1], "Properties") == 0) | ||
| 504 | { | ||
| 505 | - xfce_pointers_helper_change_property (device_info, device, xdisplay, | ||
| 506 | + xfce_pointers_helper_change_property (device_info, device_data->device, xdisplay, | ||
| 507 | names[2], value); | ||
| 508 | } | ||
| 509 | #endif | ||
| 510 | else if (strcmp (names[1], "Mode") == 0) | ||
| 511 | { | ||
| 512 | - xfce_pointers_helper_change_mode (device_info, device, xdisplay, | ||
| 513 | + xfce_pointers_helper_change_mode (device_info, device_data->device, xdisplay, | ||
| 514 | g_value_get_string (value)); | ||
| 515 | } | ||
| 516 | + else if (strcmp (names[1], "TouchscreenPointer") == 0) | ||
| 517 | + { | ||
| 518 | + /* only hide if the current device's property was changed */ | ||
| 519 | + if (device_info->id == helper->last_pointer_active) | ||
| 520 | + { | ||
| 521 | + if (G_LIKELY (G_IS_OBJECT (helper->xsettings_helper))) | ||
| 522 | + g_object_set_property (helper->xsettings_helper, "touchscreen-pointer", value); | ||
| 523 | + else | ||
| 524 | + g_critical ("xsettings_helper was not properly set"); | ||
| 525 | + } | ||
| 526 | + } | ||
| 527 | else | ||
| 528 | { | ||
| 529 | g_warning ("Unknown property %s set for device %s", | ||
| 530 | property_name, device_info->name); | ||
| 531 | } | ||
| 532 | |||
| 533 | - XCloseDevice (xdisplay, device); | ||
| 534 | - | ||
| 535 | /* stop searching */ | ||
| 536 | n = ndevices; | ||
| 537 | } | ||
| 538 | @@ -1072,26 +1162,44 @@ xfce_pointers_helper_channel_property_changed (XfconfChannel *channel, | ||
| 539 | |||
| 540 | |||
| 541 | |||
| 542 | -#ifdef DEVICE_HOTPLUGGING | ||
| 543 | static GdkFilterReturn | ||
| 544 | xfce_pointers_helper_event_filter (GdkXEvent *xevent, | ||
| 545 | GdkEvent *gdk_event, | ||
| 546 | gpointer user_data) | ||
| 547 | { | ||
| 548 | + XDevicePresenceNotifyEvent *dpn_event; | ||
| 549 | XEvent *event = xevent; | ||
| 550 | - XDevicePresenceNotifyEvent *dpn_event = xevent; | ||
| 551 | XfcePointersHelper *helper = XFCE_POINTERS_HELPER (user_data); | ||
| 552 | |||
| 553 | - if (event->type == helper->device_presence_event_type) | ||
| 554 | + /* Comparison for device changed is done here redundantly to prevent call | ||
| 555 | + * on every mouse move. | ||
| 556 | + */ | ||
| 557 | + if (event->type == helper->device_motion_event_type | ||
| 558 | + && helper->last_pointer_active != ((XDeviceMotionEvent*)xevent)->deviceid) | ||
| 559 | + xfce_pointers_helper_change_current_device (helper, &((XDeviceMotionEvent*)xevent)->deviceid); | ||
| 560 | + else if (event->type == helper->device_button_press_event_type | ||
| 561 | + && helper->last_pointer_active != ((XDeviceButtonEvent*)xevent)->deviceid) | ||
| 562 | + xfce_pointers_helper_change_current_device (helper, &((XDeviceButtonEvent*)xevent)->deviceid); | ||
| 563 | + | ||
| 564 | +#ifdef DEVICE_HOTPLUGGING | ||
| 565 | + /* handle device add/remove */ | ||
| 566 | + else if (event->type == helper->device_presence_event_type) | ||
| 567 | { | ||
| 568 | + dpn_event = xevent; | ||
| 569 | /* restore device settings */ | ||
| 570 | if (dpn_event->devchange == DeviceAdded) | ||
| 571 | xfce_pointers_helper_restore_devices (helper, &dpn_event->deviceid); | ||
| 572 | + else if(dpn_event->devchange == DeviceRemoved) | ||
| 573 | + /* we could try to find a remaining pointer to set that as active | ||
| 574 | + * one but that might not fit and as soon as the user works with | ||
| 575 | + * another pointer we are changing to correct one. | ||
| 576 | + */ | ||
| 577 | + g_hash_table_remove (helper->pointer_devices, &dpn_event->deviceid); | ||
| 578 | |||
| 579 | /* check if we need to launch syndaemon */ | ||
| 580 | xfce_pointers_helper_syndaemon_check (helper); | ||
| 581 | } | ||
| 582 | +#endif | ||
| 583 | |||
| 584 | return GDK_FILTER_CONTINUE; | ||
| 585 | } | ||
| 586 | -#endif | ||
| 587 | -- | ||
| 588 | 1.8.3.1 | ||
| 589 | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/invisible b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/invisible deleted file mode 100644 index ef4d9aadb6..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/invisible +++ /dev/null | |||
| Binary files differ | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/wait b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/wait deleted file mode 100644 index 8b9ac7e20a..0000000000 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings/touchscreen/wait +++ /dev/null | |||
| Binary files differ | |||
diff --git a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings_git.bb b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings_git.bb index 5ce38b9131..25fa292767 100644 --- a/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings_git.bb +++ b/meta-xfce/recipes-xfce/xfce4-settings/xfce4-settings_git.bb | |||
| @@ -6,11 +6,12 @@ DEPENDS = "exo exo-native garcon gtk+ libxfce4util libxfce4ui xfconf dbus-glib l | |||
| 6 | 6 | ||
| 7 | inherit xfce xfce-git | 7 | inherit xfce xfce-git |
| 8 | 8 | ||
| 9 | SRC_URI = " git://github.com/schnitzeltony/xfce4-settings.git;protocol=git;branch=for-oe-4.12.0 \ | 9 | # schnitzeltony git repo is the mainline repo |
| 10 | file://0001-xsettings.xml-remove-trouble-causing-comment.patch \ | 10 | # + datetime-setter - sent to mainline but strange response |
| 11 | file://0002-xsettings.xml-Set-default-themes.patch \ | 11 | # + minor bugfixes - sent mainline but no response |
| 12 | " | 12 | # + option to hide mousepointer for a specific (touch) input device - sent mainline but no response |
| 13 | SRCREV = "a4540c2350cecf53f7095027edd102c6a24e36af" | 13 | SRC_URI = "git://github.com/schnitzeltony/xfce4-settings.git;protocol=git;branch=for-oe-4.12.0" |
| 14 | SRCREV = "30bc3db17e0c634e41d2f099de6f39bb894906cd" | ||
| 14 | S = "${WORKDIR}/git" | 15 | S = "${WORKDIR}/git" |
| 15 | PV = "4.12.0+git${SRCPV}" | 16 | PV = "4.12.0+git${SRCPV}" |
| 16 | 17 | ||
