diff options
author | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-07-02 13:42:47 +0100 |
---|---|---|
committer | Jon TURNEY <jon.turney@dronecode.org.uk> | 2015-07-02 13:42:47 +0100 |
commit | de350c3610e49270a0f422663a42deb4b94b5bb0 (patch) | |
tree | 41dfe9b56fa96c2b95fe64fb3901ebbc208161df /hw | |
parent | 7c61592022ea519edf92e86d721d707580eacbdb (diff) | |
parent | 2123f7682d522619f101b05fb75efa75dabbe371 (diff) |
Merge tag 'xorg-server-1.17.2' into cygwin-release-1.17
xorg-server-1.17.2
Conflicts:
hw/xwin/glx/gen_gl_wrappers.py
hw/xwin/winprocarg.c
Diffstat (limited to 'hw')
-rw-r--r-- | hw/kdrive/ephyr/ephyrinit.c | 11 | ||||
-rw-r--r-- | hw/kdrive/ephyr/hostx.c | 27 | ||||
-rw-r--r-- | hw/kdrive/fake/Makefile.am | 1 | ||||
-rw-r--r-- | hw/kdrive/fbdev/Makefile.am | 1 | ||||
-rw-r--r-- | hw/xfree86/common/xf86Events.c | 7 | ||||
-rw-r--r-- | hw/xfree86/common/xf86platformBus.c | 20 | ||||
-rw-r--r-- | hw/xfree86/drivers/modesetting/drmmode_display.c | 4 | ||||
-rw-r--r-- | hw/xfree86/drivers/modesetting/dumb_bo.c | 4 | ||||
-rw-r--r-- | hw/xfree86/int10/generic.c | 2 | ||||
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.h | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/int10/linux.c | 2 | ||||
-rw-r--r-- | hw/xfree86/os-support/linux/systemd-logind.c | 17 | ||||
-rwxr-xr-x | hw/xfree86/sdksyms.sh | 14 | ||||
-rw-r--r-- | hw/xnest/Keyboard.c | 4 | ||||
-rw-r--r-- | hw/xwayland/Makefile.am | 1 | ||||
-rw-r--r-- | hw/xwayland/xwayland-cursor.c | 26 | ||||
-rw-r--r-- | hw/xwayland/xwayland-glamor.c | 4 | ||||
-rw-r--r-- | hw/xwayland/xwayland-input.c | 57 | ||||
-rw-r--r-- | hw/xwayland/xwayland-output.c | 4 | ||||
-rw-r--r-- | hw/xwayland/xwayland.c | 4 | ||||
-rw-r--r-- | hw/xwayland/xwayland.h | 8 | ||||
-rw-r--r-- | hw/xwin/winclipboard/Makefile.am | 2 |
22 files changed, 140 insertions, 82 deletions
diff --git a/hw/kdrive/ephyr/ephyrinit.c b/hw/kdrive/ephyr/ephyrinit.c index 897aa1955..8fbaf1d44 100644 --- a/hw/kdrive/ephyr/ephyrinit.c +++ b/hw/kdrive/ephyr/ephyrinit.c @@ -52,6 +52,13 @@ void processScreenOrOutputArg(const char *screen_size, const char *output, char void processOutputArg(const char *output, char *parent_id); void processScreenArg(const char *screen_size, char *parent_id); +int +main(int argc, char *argv[], char *envp[]) +{ + hostx_use_resname(basename(argv[0]), 0); + return dix_main(argc, argv, envp); +} + void InitCard(char *name) { @@ -209,10 +216,6 @@ ddxProcessArgument(int argc, char **argv, int i) EPHYR_DBG("mark argv[%d]='%s'", i, argv[i]); - if (i == 1) { - hostx_use_resname(basename(argv[0]), 0); - } - if (!strcmp(argv[i], "-parent")) { if (i + 1 < argc) { int j; diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index f64861b50..71c1691c4 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -177,7 +177,7 @@ hostx_set_win_title(KdScreenInfo *screen, const char *extra_text) memset(buf, 0, BUF_LEN + 1); snprintf(buf, BUF_LEN, "Xephyr on %s.%d %s", - HostX.server_dpy_name, + HostX.server_dpy_name ? HostX.server_dpy_name : ":0", scrpriv->mynum, (extra_text != NULL) ? extra_text : ""); xcb_icccm_set_wm_name(HostX.conn, @@ -443,7 +443,7 @@ hostx_init(void) else #endif HostX.conn = xcb_connect(NULL, &HostX.screen); - if (xcb_connection_has_error(HostX.conn)) { + if (!HostX.conn || xcb_connection_has_error(HostX.conn)) { fprintf(stderr, "\nXephyr cannot open host display. Is DISPLAY set?\n"); exit(1); } @@ -798,7 +798,7 @@ hostx_screen_init(KdScreenInfo *screen, } EPHYR_DBG("host_screen=%p x=%d, y=%d, wxh=%dx%d, buffer_height=%d", - host_screen, x, y, width, height, buffer_height); + screen, x, y, width, height, buffer_height); if (scrpriv->ximg != NULL) { /* Free up the image data if previously used @@ -866,6 +866,11 @@ hostx_screen_init(KdScreenInfo *screen, ~0, NULL); + /* Match server byte order so that the image can be converted to + * the native byte order by xcb_image_put() before drawing */ + if (host_depth_matches_server(scrpriv)) + scrpriv->ximg->byte_order = IMAGE_BYTE_ORDER; + scrpriv->ximg->data = malloc(scrpriv->ximg->stride * buffer_height); } @@ -1034,8 +1039,11 @@ hostx_paint_rect(KdScreenInfo *screen, sx, sy, dx, dy, width, height, FALSE); } else { - xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, scrpriv->ximg, - dx, dy, 0); + /* This is slow and could be done better */ + xcb_image_t *img = xcb_image_native (HostX.conn, scrpriv->ximg, 1); + xcb_image_put(HostX.conn, scrpriv->win, HostX.gc, img, 0, 0, 0); + if (scrpriv->ximg != img) + xcb_image_destroy(img); } xcb_aux_sync(HostX.conn); @@ -1407,9 +1415,12 @@ ephyr_glamor_init(ScreenPtr screen) ephyr_glamor_set_window_size(scrpriv->glamor, scrpriv->win_width, scrpriv->win_height); - glamor_init(screen, - GLAMOR_USE_SCREEN | - GLAMOR_USE_PICTURE_SCREEN); + if (!glamor_init(screen, + GLAMOR_USE_SCREEN | + GLAMOR_USE_PICTURE_SCREEN)) { + FatalError("Failed to initialize glamor\n"); + return FALSE; + } return TRUE; } diff --git a/hw/kdrive/fake/Makefile.am b/hw/kdrive/fake/Makefile.am index 14c99c3cc..d28bd2752 100644 --- a/hw/kdrive/fake/Makefile.am +++ b/hw/kdrive/fake/Makefile.am @@ -18,6 +18,7 @@ Xfake_SOURCES = \ Xfake_LDADD = \ libfake.la \ + @KDRIVE_MAIN_LIB@ \ @KDRIVE_LIBS@ Xfake_LDFLAGS = $(LD_EXPORT_SYMBOLS_FLAG) diff --git a/hw/kdrive/fbdev/Makefile.am b/hw/kdrive/fbdev/Makefile.am index 7e8ba024c..d550c1391 100644 --- a/hw/kdrive/fbdev/Makefile.am +++ b/hw/kdrive/fbdev/Makefile.am @@ -16,6 +16,7 @@ Xfbdev_SOURCES = \ Xfbdev_LDADD = \ libfbdev.la \ + @KDRIVE_MAIN_LIB@ \ @KDRIVE_LIBS@ Xfbdev_DEPENDENCIES = \ diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c index 16b3e2821..2b84d8669 100644 --- a/hw/xfree86/common/xf86Events.c +++ b/hw/xfree86/common/xf86Events.c @@ -583,10 +583,11 @@ xf86VTEnter(void) /* Turn screen saver off when switching back */ dixSaveScreens(serverClient, SCREEN_SAVER_FORCER, ScreenSaverReset); - /* If we use systemd-logind it will enable input devices for us */ - if (!systemd_logind_controls_session()) - for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) + for (pInfo = xf86InputDevs; pInfo; pInfo = pInfo->next) { + /* Devices with server managed fds get enabled on logind resume */ + if (!(pInfo->flags & XI86_SERVER_FD)) xf86EnableInputDeviceForVTSwitch(pInfo); + } for (ih = InputHandlers; ih; ih = ih->next) { if (ih->is_input) diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c index 15988b8b1..c1aaba41a 100644 --- a/hw/xfree86/common/xf86platformBus.c +++ b/hw/xfree86/common/xf86platformBus.c @@ -153,8 +153,10 @@ xf86_check_platform_slot(const struct xf86_platform_device *pd) for (i = 0; i < xf86NumEntities; i++) { const EntityPtr u = xf86Entities[i]; - if (pd->pdev && u->bus.type == BUS_PCI) - return !MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci); + if (pd->pdev && u->bus.type == BUS_PCI && + MATCH_PCI_DEVICES(pd->pdev, u->bus.id.pci)) { + return FALSE; + } if ((u->bus.type == BUS_PLATFORM) && (pd == u->bus.id.plat)) { return FALSE; } @@ -426,6 +428,10 @@ xf86platformProbeDev(DriverPtr drvp) /* find the main device or any device specificed in xorg.conf */ for (i = 0; i < numDevs; i++) { + /* skip inactive devices */ + if (!devList[i]->active) + continue; + for (j = 0; j < xf86_num_platform_devices; j++) { if (devList[i]->busID && *devList[i]->busID) { if (xf86PlatformDeviceCheckBusID(&xf86_platform_devices[j], devList[i]->busID)) @@ -449,10 +455,14 @@ xf86platformProbeDev(DriverPtr drvp) continue; } - /* if autoaddgpu devices is enabled then go find a few more and add them as GPU screens */ - if (xf86Info.autoAddGPU && numDevs) { + /* if autoaddgpu devices is enabled then go find any unclaimed platform + * devices and add them as GPU screens */ + if (xf86Info.autoAddGPU) { for (j = 0; j < xf86_num_platform_devices; j++) { - probeSingleDevice(&xf86_platform_devices[j], drvp, devList[0], PLATFORM_PROBE_GPU_SCREEN); + if (probeSingleDevice(&xf86_platform_devices[j], drvp, + devList ? devList[0] : NULL, + PLATFORM_PROBE_GPU_SCREEN)) + foundScreen = TRUE; } } diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index 1ea799b3a..a8de5f9e7 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -427,10 +427,10 @@ drmmode_set_cursor(xf86CrtcPtr crtc) drmModeSetCursor2(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, ms->cursor_width, ms->cursor_height, cursor->bits->xhot, cursor->bits->yhot); + if (!ret) + return; if (ret == -EINVAL) use_set_cursor2 = FALSE; - else - return; } ret = drmModeSetCursor(drmmode->fd, drmmode_crtc->mode_crtc->crtc_id, handle, diff --git a/hw/xfree86/drivers/modesetting/dumb_bo.c b/hw/xfree86/drivers/modesetting/dumb_bo.c index 58d420e07..cf13f0a9c 100644 --- a/hw/xfree86/drivers/modesetting/dumb_bo.c +++ b/hw/xfree86/drivers/modesetting/dumb_bo.c @@ -25,6 +25,10 @@ * */ +#ifdef HAVE_DIX_CONFIG_H +#include "dix-config.h" +#endif + #include "dumb_bo.h" #include <errno.h> diff --git a/hw/xfree86/int10/generic.c b/hw/xfree86/int10/generic.c index 012d1941a..8d5c4daf3 100644 --- a/hw/xfree86/int10/generic.c +++ b/hw/xfree86/int10/generic.c @@ -104,7 +104,7 @@ readIntVec(struct pci_device *dev, unsigned char *buf, int len) { void *map; - if (!pci_device_map_legacy(dev, 0, len, 0, &map)) + if (pci_device_map_legacy(dev, 0, len, 0, &map)) return FALSE; memcpy(buf, map, len); diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h index 692bf40b9..54b6e5cd7 100644 --- a/hw/xfree86/modes/xf86Crtc.h +++ b/hw/xfree86/modes/xf86Crtc.h @@ -732,6 +732,8 @@ xf86CompatOutput(ScrnInfoPtr pScrn) { xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + if (config->compat_output < 0) + return NULL; return config->output[config->compat_output]; } diff --git a/hw/xfree86/os-support/linux/int10/linux.c b/hw/xfree86/os-support/linux/int10/linux.c index 79b9a8858..6ca118f25 100644 --- a/hw/xfree86/os-support/linux/int10/linux.c +++ b/hw/xfree86/os-support/linux/int10/linux.c @@ -75,7 +75,7 @@ readLegacy(struct pci_device *dev, unsigned char *buf, int base, int len) { void *map; - if (!pci_device_map_legacy(dev, base, len, 0, &map)) + if (pci_device_map_legacy(dev, base, len, 0, &map)) return FALSE; memcpy(buf, map, len); diff --git a/hw/xfree86/os-support/linux/systemd-logind.c b/hw/xfree86/os-support/linux/systemd-logind.c index 49758f465..4ad41a374 100644 --- a/hw/xfree86/os-support/linux/systemd-logind.c +++ b/hw/xfree86/os-support/linux/systemd-logind.c @@ -40,8 +40,6 @@ #include "systemd-logind.h" -#define DBUS_TIMEOUT 500 /* Wait max 0.5 seconds */ - struct systemd_logind_info { DBusConnection *conn; char *session; @@ -130,7 +128,7 @@ systemd_logind_take_fd(int _major, int _minor, const char *path, } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to take device %s: %s\n", path, error.message); @@ -207,7 +205,7 @@ systemd_logind_release_fd(int _major, int _minor, int fd) } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) LogMessage(X_ERROR, "systemd-logind: failed to release device: %s\n", error.message); @@ -289,7 +287,7 @@ systemd_logind_ack_pause(struct systemd_logind_info *info, } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) LogMessage(X_ERROR, "systemd-logind: failed to ack pause: %s\n", error.message); @@ -313,6 +311,9 @@ message_filter(DBusConnection * connection, DBusMessage * message, void *data) dbus_int32_t major, minor; char *pause_str; + if (dbus_message_get_type (message) != DBUS_MESSAGE_TYPE_SIGNAL) + return DBUS_HANDLER_RESULT_NOT_YET_HANDLED; + dbus_error_init(&error); if (dbus_message_is_signal(message, @@ -454,7 +455,7 @@ connect_hook(DBusConnection *connection, void *data) } reply = dbus_connection_send_with_reply_and_block(connection, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: failed to get session: %s\n", error.message); @@ -489,7 +490,7 @@ connect_hook(DBusConnection *connection, void *data) } reply = dbus_connection_send_with_reply_and_block(connection, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: TakeControl failed: %s\n", error.message); @@ -561,7 +562,7 @@ systemd_logind_release_control(struct systemd_logind_info *info) } reply = dbus_connection_send_with_reply_and_block(info->conn, msg, - DBUS_TIMEOUT, &error); + DBUS_TIMEOUT_USE_DEFAULT, &error); if (!reply) { LogMessage(X_ERROR, "systemd-logind: ReleaseControl failed: %s\n", error.message); diff --git a/hw/xfree86/sdksyms.sh b/hw/xfree86/sdksyms.sh index fb60dff9f..530d6f548 100755 --- a/hw/xfree86/sdksyms.sh +++ b/hw/xfree86/sdksyms.sh @@ -350,13 +350,25 @@ BEGIN { if (sdk) { n = 3; + # skip line numbers GCC 5 adds before __attribute__ + while ($n == "" || $0 ~ /^# [0-9]+ "/) { + getline; + n = 1; + } + # skip attribute, if any while ($n ~ /^(__attribute__|__global)/ || # skip modifiers, if any $n ~ /^\*?(unsigned|const|volatile|struct|_X_EXPORT)$/ || # skip pointer - $n ~ /^[a-zA-Z0-9_]*\*$/) + $n ~ /^[a-zA-Z0-9_]*\*$/) { n++; + # skip line numbers GCC 5 adds after __attribute__ + while ($n == "" || $0 ~ /^# [0-9]+ "/) { + getline; + n = 1; + } + } # type specifier may not be set, as in # extern _X_EXPORT unsigned name(...) diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index ee3f68e3f..ae8375ee3 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -16,6 +16,10 @@ is" without express or implied warranty. #include <xnest-config.h> #endif +#ifdef WIN32 +#include <X11/Xwindows.h> +#endif + #include <X11/X.h> #include <X11/Xproto.h> #include <xcb/xcb_keysyms.h> diff --git a/hw/xwayland/Makefile.am b/hw/xwayland/Makefile.am index 994554088..ab1bbb6a5 100644 --- a/hw/xwayland/Makefile.am +++ b/hw/xwayland/Makefile.am @@ -43,6 +43,7 @@ xwayland-glamor.c : $(nodist_Xwayland_SOURCES) glamor_lib = $(top_builddir)/glamor/libglamor.la Xwayland_LDADD += $(GLAMOR_LIBS) $(GBM_LIBS) -lEGL -lGL +Xwayland_DEPENDENCIES = $(glamor_lib) endif EXTRA_DIST = drm.xml diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c index 5a9d1fe70..c137e1ec0 100644 --- a/hw/xwayland/xwayland-cursor.c +++ b/hw/xwayland/xwayland-cursor.c @@ -82,6 +82,23 @@ xwl_unrealize_cursor(DeviceIntPtr device, ScreenPtr screen, CursorPtr cursor) return xwl_shm_destroy_pixmap(pixmap); } +static void +frame_callback(void *data, + struct wl_callback *callback, + uint32_t time) +{ + struct xwl_seat *xwl_seat = data; + xwl_seat->cursor_frame_cb = NULL; + if (xwl_seat->cursor_needs_update) { + xwl_seat->cursor_needs_update = FALSE; + xwl_seat_set_cursor(xwl_seat); + } +} + +static const struct wl_callback_listener frame_listener = { + frame_callback +}; + void xwl_seat_set_cursor(struct xwl_seat *xwl_seat) { @@ -98,6 +115,11 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) return; } + if (xwl_seat->cursor_frame_cb) { + xwl_seat->cursor_needs_update = TRUE; + return; + } + cursor = xwl_seat->x_cursor; pixmap = dixGetPrivate(&cursor->devPrivates, &xwl_cursor_private_key); stride = cursor->bits->width * 4; @@ -117,6 +139,10 @@ xwl_seat_set_cursor(struct xwl_seat *xwl_seat) wl_surface_damage(xwl_seat->cursor, 0, 0, xwl_seat->x_cursor->bits->width, xwl_seat->x_cursor->bits->height); + + xwl_seat->cursor_frame_cb = wl_surface_frame(xwl_seat->cursor); + wl_callback_add_listener(xwl_seat->cursor_frame_cb, &frame_listener, xwl_seat); + wl_surface_commit(xwl_seat->cursor); } diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c index dd8551840..d574d9407 100644 --- a/hw/xwayland/xwayland-glamor.c +++ b/hw/xwayland/xwayland-glamor.c @@ -310,7 +310,7 @@ xwl_drm_init_egl(struct xwl_screen *xwl_screen) } if (!epoxy_has_gl_extension("GL_OES_EGL_image")) { - ErrorF("GL_OES_EGL_image no available"); + ErrorF("GL_OES_EGL_image not available\n"); return; } @@ -329,7 +329,7 @@ xwl_drm_handle_device(void *data, struct wl_drm *drm, const char *device) xwl_screen->drm_fd = open(xwl_screen->device_name, O_RDWR | O_CLOEXEC); if (xwl_screen->drm_fd == -1) { - ErrorF("wayland-egl: could not open %s (%s)", + ErrorF("wayland-egl: could not open %s (%s)\n", xwl_screen->device_name, strerror(errno)); return; } diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c index 5e204189f..4639048d9 100644 --- a/hw/xwayland/xwayland-input.c +++ b/hw/xwayland/xwayland-input.c @@ -43,7 +43,7 @@ static int xwl_pointer_proc(DeviceIntPtr device, int what) { #define NBUTTONS 10 -#define NAXES 2 +#define NAXES 4 BYTE map[NBUTTONS + 1]; int i = 0; Atom btn_labels[NBUTTONS] = { 0 }; @@ -67,8 +67,10 @@ xwl_pointer_proc(DeviceIntPtr device, int what) axes_labels[0] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_X); axes_labels[1] = XIGetKnownProperty(AXIS_LABEL_PROP_ABS_Y); + axes_labels[2] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_HWHEEL); + axes_labels[3] = XIGetKnownProperty(AXIS_LABEL_PROP_REL_WHEEL); - if (!InitValuatorClassDeviceStruct(device, 2, btn_labels, + if (!InitValuatorClassDeviceStruct(device, NAXES, btn_labels, GetMotionHistorySize(), Absolute)) return BadValue; @@ -77,6 +79,13 @@ xwl_pointer_proc(DeviceIntPtr device, int what) 0, 0xFFFF, 10000, 0, 10000, Absolute); InitValuatorAxisStruct(device, 1, axes_labels[1], 0, 0xFFFF, 10000, 0, 10000, Absolute); + InitValuatorAxisStruct(device, 2, axes_labels[2], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative); + InitValuatorAxisStruct(device, 3, axes_labels[3], + NO_AXIS_LIMITS, NO_AXIS_LIMITS, 0, 0, 0, Relative); + + SetScrollValuator(device, 2, SCROLL_TYPE_HORIZONTAL, 1.0, SCROLL_FLAG_NONE); + SetScrollValuator(device, 3, SCROLL_TYPE_VERTICAL, 1.0, SCROLL_FLAG_PREFERRED); if (!InitPtrFeedbackClassDeviceStruct(device, xwl_pointer_control)) return BadValue; @@ -259,54 +268,24 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer, uint32_t time, uint32_t axis, wl_fixed_t value) { struct xwl_seat *xwl_seat = data; - int index, count; - int i, val; + int index; const int divisor = 10; ValuatorMask mask; - if (time - xwl_seat->scroll_time > 2000) { - xwl_seat->vertical_scroll = 0; - xwl_seat->horizontal_scroll = 0; - } - xwl_seat->scroll_time = time; - - /* FIXME: Need to do proper smooth scrolling here! */ switch (axis) { case WL_POINTER_AXIS_VERTICAL_SCROLL: - xwl_seat->vertical_scroll += value / divisor; - val = wl_fixed_to_int(xwl_seat->vertical_scroll); - xwl_seat->vertical_scroll -= wl_fixed_from_int(val); - - if (val <= -1) - index = 4; - else if (val >= 1) - index = 5; - else - return; + index = 3; break; case WL_POINTER_AXIS_HORIZONTAL_SCROLL: - xwl_seat->horizontal_scroll += value / divisor; - val = wl_fixed_to_int(xwl_seat->horizontal_scroll); - xwl_seat->horizontal_scroll -= wl_fixed_from_int(val); - - if (val <= -1) - index = 6; - else if (val >= 1) - index = 7; - else - return; + index = 2; break; default: return; } valuator_mask_zero(&mask); - - count = abs(val); - for (i = 0; i < count; i++) { - QueuePointerEvents(xwl_seat->pointer, ButtonPress, index, 0, &mask); - QueuePointerEvents(xwl_seat->pointer, ButtonRelease, index, 0, &mask); - } + valuator_mask_set_double(&mask, index, wl_fixed_to_double(value) / divisor); + QueuePointerEvents(xwl_seat->pointer, MotionNotify, 0, POINTER_RELATIVE, &mask); } static const struct wl_pointer_listener pointer_listener = { @@ -567,7 +546,7 @@ create_input_device(struct xwl_screen *xwl_screen, uint32_t id) xwl_seat = calloc(sizeof *xwl_seat, 1); if (xwl_seat == NULL) { - ErrorF("create_input ENOMEM"); + ErrorF("create_input ENOMEM\n"); return; } @@ -590,6 +569,8 @@ xwl_seat_destroy(struct xwl_seat *xwl_seat) RemoveDevice(xwl_seat->keyboard, FALSE); wl_seat_destroy(xwl_seat->seat); wl_surface_destroy(xwl_seat->cursor); + if (xwl_seat->cursor_frame_cb) + wl_callback_destroy(xwl_seat->cursor_frame_cb); wl_array_release(&xwl_seat->keys); free(xwl_seat); } diff --git a/hw/xwayland/xwayland-output.c b/hw/xwayland/xwayland-output.c index 778914c61..155cbc109 100644 --- a/hw/xwayland/xwayland-output.c +++ b/hw/xwayland/xwayland-output.c @@ -159,7 +159,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) xwl_output = calloc(sizeof *xwl_output, 1); if (xwl_output == NULL) { - ErrorF("create_output ENOMEM"); + ErrorF("create_output ENOMEM\n"); return NULL; } @@ -168,7 +168,7 @@ xwl_output_create(struct xwl_screen *xwl_screen, uint32_t id) wl_output_add_listener(xwl_output->output, &output_listener, xwl_output); if (snprintf(name, sizeof name, "XWAYLAND%d", serial++) < 0) { - ErrorF("create_output ENOMEM"); + ErrorF("create_output ENOMEM\n"); free(xwl_output); return NULL; } diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c index 7e8d667d6..bc92beb38 100644 --- a/hw/xwayland/xwayland.c +++ b/hw/xwayland/xwayland.c @@ -483,7 +483,7 @@ listen_on_fds(struct xwl_screen *xwl_screen) int i; for (i = 0; i < xwl_screen->listen_fd_count; i++) - ListenOnOpenFD(xwl_screen->listen_fds[i], TRUE); + ListenOnOpenFD(xwl_screen->listen_fds[i], FALSE); } static void @@ -702,4 +702,6 @@ InitOutput(ScreenInfo * screen_info, int argc, char **argv) if (AddScreen(xwl_screen_init, argc, argv) == -1) { FatalError("Couldn't add screen\n"); } + + LocalAccessScopeUser(); } diff --git a/hw/xwayland/xwayland.h b/hw/xwayland/xwayland.h index bfffa712f..28b0c995e 100644 --- a/hw/xwayland/xwayland.h +++ b/hw/xwayland/xwayland.h @@ -115,16 +115,14 @@ struct xwl_seat { struct wl_pointer *wl_pointer; struct wl_keyboard *wl_keyboard; struct wl_array keys; - struct wl_surface *cursor; struct xwl_window *focus_window; uint32_t id; uint32_t pointer_enter_serial; struct xorg_list link; CursorPtr x_cursor; - - wl_fixed_t horizontal_scroll; - wl_fixed_t vertical_scroll; - uint32_t scroll_time; + struct wl_surface *cursor; + struct wl_callback *cursor_frame_cb; + Bool cursor_needs_update; size_t keymap_size; char *keymap; diff --git a/hw/xwin/winclipboard/Makefile.am b/hw/xwin/winclipboard/Makefile.am index b1c95f4ef..a1079aec6 100644 --- a/hw/xwin/winclipboard/Makefile.am +++ b/hw/xwin/winclipboard/Makefile.am @@ -19,7 +19,7 @@ xwinclip_SOURCES = xwinclip.c debug.c xwinclip_CFLAGS = $(XWINMODULES_CFLAGS) -xwinclip_LDADD = libXWinclipboard.la $(XWINMODULES_LIBS) -lgdi32 +xwinclip_LDADD = libXWinclipboard.la $(XWINMODULES_LIBS) -lgdi32 -lpthread include $(top_srcdir)/manpages.am appman_PRE = xwinclip.man |