diff options
author | monsta <[email protected]> | 2016-10-27 18:18:05 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-10-27 18:18:05 +0300 |
commit | 88930d3d5f49720ee22c4aeefacad1f88bfac838 (patch) | |
tree | 623b0825c5c14cf17fe81f7cf2e0ab4d19890e49 | |
parent | 6dda2942a3bd70767476186d4fd9c186f1891000 (diff) | |
download | mate-settings-daemon-88930d3d5f49720ee22c4aeefacad1f88bfac838.tar.bz2 mate-settings-daemon-88930d3d5f49720ee22c4aeefacad1f88bfac838.tar.xz |
mouse: don't copy struct when it's not needed, pass pointer instead
-rw-r--r-- | plugins/common/msd-input-helper.c | 8 | ||||
-rw-r--r-- | plugins/common/msd-input-helper.h | 2 | ||||
-rw-r--r-- | plugins/mouse/msd-mouse-manager.c | 12 |
3 files changed, 11 insertions, 11 deletions
diff --git a/plugins/common/msd-input-helper.c b/plugins/common/msd-input-helper.c index b8e87a3..d5dd0c9 100644 --- a/plugins/common/msd-input-helper.c +++ b/plugins/common/msd-input-helper.c @@ -42,7 +42,7 @@ supports_xinput_devices (void) } XDevice* -device_is_touchpad (XDeviceInfo deviceinfo) +device_is_touchpad (XDeviceInfo *deviceinfo) { XDevice *device; Atom realtype, prop; @@ -50,7 +50,7 @@ device_is_touchpad (XDeviceInfo deviceinfo) unsigned long nitems, bytes_after; unsigned char *data; - if (deviceinfo.type != XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XI_TOUCHPAD, False)) + if (deviceinfo->type != XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), XI_TOUCHPAD, False)) return NULL; prop = XInternAtom (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), "Synaptics Off", False); @@ -58,7 +58,7 @@ device_is_touchpad (XDeviceInfo deviceinfo) return NULL; gdk_error_trap_push (); - device = XOpenDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), deviceinfo.id); + device = XOpenDevice (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), deviceinfo->id); if (gdk_error_trap_pop () || (device == NULL)) return NULL; @@ -104,7 +104,7 @@ touchpad_is_present (void) for (i = 0; i < n_devices; i++) { XDevice *device; - device = device_is_touchpad (device_info[i]); + device = device_is_touchpad (&device_info[i]); if (device != NULL) { retval = TRUE; break; diff --git a/plugins/common/msd-input-helper.h b/plugins/common/msd-input-helper.h index a95d6a8..e46c97e 100644 --- a/plugins/common/msd-input-helper.h +++ b/plugins/common/msd-input-helper.h @@ -28,7 +28,7 @@ G_BEGIN_DECLS #include <X11/extensions/XIproto.h> gboolean supports_xinput_devices (void); -XDevice *device_is_touchpad (XDeviceInfo deviceinfo); +XDevice *device_is_touchpad (XDeviceInfo *deviceinfo); gboolean touchpad_is_present (void); G_END_DECLS diff --git a/plugins/mouse/msd-mouse-manager.c b/plugins/mouse/msd-mouse-manager.c index 54f1625..f1c209a 100644 --- a/plugins/mouse/msd-mouse-manager.c +++ b/plugins/mouse/msd-mouse-manager.c @@ -256,7 +256,7 @@ set_left_handed (MsdMouseManager * manager, gboolean left_handed) /* If the device is a touchpad, swap tap buttons * around too, otherwise a tap would be a right-click */ - device = device_is_touchpad (device_info[i]); + device = device_is_touchpad (&device_info[i]); if (device != NULL) { gboolean tap = g_settings_get_boolean (manager->priv->settings_touchpad, KEY_TOUCHPAD_TAP_TO_CLICK); gboolean single_button = touchpad_has_single_button (device); @@ -538,7 +538,7 @@ set_tap_to_click (MsdMouseManager * manager) gint three_finger_tap = g_settings_get_int (manager->priv->settings_touchpad, KEY_TOUCHPAD_THREE_FINGER_TAP); for (i = 0; i < numdevices; i++) { - if ((device = device_is_touchpad (devicelist[i]))) { + if ((device = device_is_touchpad (&devicelist[i]))) { gdk_error_trap_push (); rc = XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, prop, 0, 2, False, XA_INTEGER, &type, &format, &nitems, @@ -595,7 +595,7 @@ set_click_actions (MsdMouseManager * manager) gint enable_three_finger_click = g_settings_get_int (manager->priv->settings_touchpad, KEY_TOUCHPAD_THREE_FINGER_CLICK); for (i = 0; i < numdevices; i++) { - if ((device = device_is_touchpad (devicelist[i]))) { + if ((device = device_is_touchpad (&devicelist[i]))) { g_debug ("setting click action to click on %s", devicelist[i].name); gdk_error_trap_push (); rc = XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, prop, 0, 2, @@ -643,7 +643,7 @@ set_natural_scroll (MsdMouseManager * manager) gboolean natural_scroll = g_settings_get_boolean (manager->priv->settings_touchpad, KEY_TOUCHPAD_NATURAL_SCROLL); for (i = 0; i < numdevices; i++) { - if ((device = device_is_touchpad (devicelist[i]))) { + if ((device = device_is_touchpad (&devicelist[i]))) { g_debug ("Trying to set %s for \"%s\"", natural_scroll ? "natural (reverse) scroll" : "normal scroll", devicelist[i].name); gdk_error_trap_push (); rc = XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, prop, 0, 2, @@ -701,7 +701,7 @@ synaptics_set_bool (const char * property_name, int property_index, gboolean ena } for (i = 0; i < numdevices; i++) { - if ((device = device_is_touchpad (devicelist[i]))) { + if ((device = device_is_touchpad (&devicelist[i]))) { gdk_error_trap_push (); rc = XGetDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, property, 0, 1, False, @@ -754,7 +754,7 @@ set_touchpad_enabled (gboolean state) return; for (i = 0; i < numdevices; i++) { - if ((device = device_is_touchpad (devicelist[i]))) { + if ((device = device_is_touchpad (&devicelist[i]))) { unsigned char data = state; gdk_error_trap_push (); XChangeDeviceProperty (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), device, |