summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2016-03-02xfixes: avoid double free if AddResource failsaddresourcesJulien Cristau1-3/+1
pChc is already freed through CursorFreeHideCount → deleteCursorHideCount. Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02render: free already allocated formats in PictureInit failure caseJulien Cristau1-0/+3
Probably pointless, if this fails you're not likely to get far... Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02record: don't call RecordDeleteContext when AddResource failsJulien Cristau1-1/+0
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02xwin: no need to free auth data if AddResource failsJulien Cristau1-14/+3
This is taken care of by SecurityDeleteAuthorization Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02modesetting: avoid double free if AddResource failsJulien Cristau1-3/+1
ms_dri2_frame_event_client_gone or ms_dri2_frame_event_drawable_gone already free the resource. Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02dmx/glxProxy: don't free the glx pixmap twice if AddResource failsJulien Cristau1-4/+1
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02glx: don't call pGlxDraw->destroy() if AddResource failsJulien Cristau1-7/+2
AddResource will have called DrawableGone, which takes care of the destruction. Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02dri3: return an error if AddResource failsJulien Cristau1-2/+2
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02xvmc: Fix unchecked AddResourceJulien Cristau1-3/+14
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02xv: fix double free in AddResource failure caseJulien Cristau1-3/+2
XvdiDestroyVideoNotifyList already frees the list if AddResource fails, so don't do it twice. And set tpn->client to NULL explicitly to avoid confusing uninitialized memory with a valid value. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-02dri1: Fix unchecked AddResourceAdam Jackson1-3/+5
Signed-off-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Julien Cristau <jcristau@debian.org>
2016-03-02xv: Fix unchecked AddResourceAdam Jackson1-2/+4
Reviewed-by: Julien Cristau <jcristau@debian.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-01vidmode: build without xf86vidmodeprotoOlivier Fourdan2-0/+6
git commit f175cf45: vidmode: move to a separate library of its own introduced a regression where the xserver would not build when xf86vidmodeproto is not installed even if the configure option "--disable-xf86vidmode" is specified. Fix build failure when xf86vidmodeproto is not installed. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-03-01kdrive/ephyr: map host X server's keymap into Xephyr, if supportedLaércio de Sousa5-27/+151
Currently Xephyr doesn't inherit host X server's keymap, which may lead to keymap mismatches when using a non-US keyboard in a window inside Xephyr. This patch makes Xephyr change its keymap to match host X server's one (unless XKB support is disabled), using xcb-xkb to retrieve the needed XKB controls. This implementation is analogous to Xnest one at commit 83fef4235. Supersedes: https://patchwork.freedesktop.org/patch/67504 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01config/udev: distinguish between real keyboards and other key devicesLaércio de Sousa6-4/+11
This patch introduces a new flag ATTR_KEY for hotplugged input devices, so we can better distinguish between real keyboards (i.e. devices with udev property ID_INPUT_KEYBOARD="1") and other key input devices like lid switches, power buttons, etc. All supported hotplug backends (udev, hal, and wscons) will set both flags ATTR_KEY and ATTR_KEYBOARD for real keyboards, but udev backend will set ATTR_KEY, but not ATTR_KEYBOARD, for non-keyboard key input devices (hal and wscons will set both flags in any case). With this distinction, kdrive input hotplugging mechanism will be allowed to only grab real keyboards, as other key input devices are currently not supported. In order to don't break current behaviour, this patch will replace all ATTR_KEYBOARD occurrences with ATTR_KEY in hw/xfree86/common/xf86Xinput.c. [ajax: Just add ATTR_KEY, don't re-number the other attributes] Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01ephyr: enable option -sw-cursor by default in multi-seat modeLaércio de Sousa1-0/+3
Option -seat passed to Xephyr requires -sw-cursor to be passed as well, otherwise the mouse cursor will remain invisible for the given seat. This patch takes care of enabling -sw-cursor if -seat is passed. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01kdrive: add options to set default XKB propertiesLaércio de Sousa2-5/+61
This patch introduces convenient command-line options -xkb-rules, -xkb-model, -xkb-layout, -xkb-variant, and -xkb-options, to set default values for these properties. These options can be handful for cases in which compile-time default values don't match user locale, since kdrive doesn't support InputClass matching rules yet and not all Linux distros provide default rules to store these values in udev properties (which by the way is a discouraged practice). Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01kdrive: introduce input hot-plugging support for udev and hal backends (#33140)Laércio de Sousa4-22/+198
This patch introduces input hot-plugging support for kdrive-based applications in multi-seat context. This feature is enabled by passing -seat option with desired seat name. All keyboard/mouse devices assigned to that seat will be automatically grabbed by kdrive. It supports udev and hal backends for input hot-plugging support. Another patches may be required for wscons backend. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=33140 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Laércio de Sousa <laerciosousa@sme-mogidascruzes.sp.gov.br>
2016-03-01xwayland: fix a crash on output removalOlivier Fourdan1-0/+1
On output removal, the CRTC that was added in xwl_output_create() is not removed in xwl_output_destroy() and would cause a segmentation fault later on in ProcRRGetMonitors(): (EE) Segmentation fault at address 0x100000001 (EE) (EE) 10: ? (?+0x29) [0x29] (EE) 9: /usr/bin/Xwayland (_start+0x29) [0x423299] (EE) 8: /lib64/libc.so.6 (__libc_start_main+0xf0) [0x7fdd80e7f580] (EE) 7: /usr/bin/Xwayland (dix_main+0x3b3) [0x544ef3] (EE) 6: /usr/bin/Xwayland (Dispatch+0x31e) [0x54109e] (EE) 5: /usr/bin/Xwayland (ProcRRGetMonitors+0x9b) [0x4ca18b] (EE) 4: /usr/bin/Xwayland (RRMonitorMakeList+0x269) [0x4c9ba9] (EE) 3: /usr/bin/Xwayland (RRMonitorSetFromServer+0x118) [0x4c9198] (EE) 2: /usr/bin/Xwayland (MakeAtom+0x30) [0x530710] (EE) 1: /lib64/libc.so.6 (__restore_rt+0x0) [0x7fdd80e93b1f] (EE) 0: /usr/bin/Xwayland (OsSigHandler+0x29) [0x5792d9] Remove the output CRTC in xwl_output_destroy() to avoid the crash. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Daniel Stone <daniels@collabora.com>
2016-03-01present: Call present_restore_screen_pixmap from present_set_abort_flipMichel Dänzer1-14/+14
After present_set_abort_flip, the screen pixmap will be used for all screen drawing, so we need to restore the current flip pixmap contents to the screen pixmap here as well. Improves flashing / stutter e.g. when something like a popup menu appears on top of a flipping fullscreen window or when switching out of fullscreen. Note that this means present_set_abort_flip now relies on screen->root being non-NULL, but that's already the case in other present code. Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01present: Factor code for restoring screen pixmap out of present_unflip (v2)Michel Dänzer1-16/+23
The following fix will use the refactored function. The logic in the refactored function is slightly simplified, exploiting the fact that this function is only ever called with a valid flip pixmap. v2: Assert that flip_pixmap is non-NULL instead of testing and bailing on NULL, preserve test for flip_window being non-NULL before calling present_set_tree_pixmap for it (Keith Packard) Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> (v1) Reviewed-by: Keith Packard <keithp@keithp.com>
2016-03-01present: Only update screen pixmap from flip pixmap once per unflipMichel Dänzer1-7/+9
present_unflip may be called several times from present_check_flip_window during the same unflip. We can only copy to the screen pixmap the first time, otherwise we may scribble over other windows. The flip pixmap contents don't get updated after the first time anyway. Fixes at least the following problems, which were introduced by commit 806470b9 ("present: Copy unflip contents back to the Screen Pixmap"): On xfwm4 without compositing, run glxgears and put its window into fullscreen mode to start flipping. While in fullscreen, open the xfwm4 window menu by pressing Alt-Space. The window menu was invisible most of the time because it was getting scribbled over by a repeated unflip copy. When switching a flipping window out of fullscreen, a repeated unflip copy could leave artifacts of the flip pixmap on the desktop. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94325 Reviewed-by: Keith Packard <keithp@keithp.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-01dri3: Refuse to work for remote clients (v2)Michel Dänzer1-0/+4
Prevents clients forwarded via SSH from hanging while waiting for the reply from the DRI3Open request. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93261 v2: Return BadMatch instead of BadRequest (Keith Packard) Reviewed-by: Keith Packard <keithp@keithp.com>
2016-02-29xwayland: add partial xvidmode extension supportOlivier Fourdan4-0/+422
Older games (mostly those based on SDL 1.x) rely on the XVidMode extension and would refuse to run without. Add a simple, limited and read-only xvidmode support that reports the current mode used so that games that rely on xvidmode extension can run on XWayland. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove redundant DIX functionOlivier Fourdan1-7/+1
The API signature of the DIX xf86VidModeGetGammaRampSize() is now identical to the xf86cmap's xf86GetGammaRampSize() and all it does is actually call xf86GetGammaRampSize() so we can save one vfunc. Remove uneeded xf86VidModeGetGammaRampSize() function. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove redundant checkOlivier Fourdan1-67/+5
The DIX already checks for VidModePrivateKey to get the vfunc, so checking for this again in the DDX is redundant. Remove the redundant function xf86VidModeAvailable() from the DDX. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: move to a separate library of its ownOlivier Fourdan12-450/+592
XVidMode extension might be useful to non hardware servers as well (e.g. Xwayand) so that applications that rely on it (e.g. lot of older games) can at least have read access to XVidMode. But the implementation is very XFree86 centric, so the idea is to add a bunch of vfunc that other non-XFree86 servers can hook up into to provide a similar functionality. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=87806 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: rename DDX functionsOlivier Fourdan3-233/+234
To avoid confusion as to what belongs on the DDX and what not. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: move display mode definitionsOlivier Fourdan3-91/+104
To be able to reuse the VidMode extension in a non-hardware server, the display mode definitions need to be accessible from DIX. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove mode access from public APIOlivier Fourdan3-111/+108
The mode access functions (namely VidModeCreateMode(), VidModeCopyMode(), VidModeGetModeValue() and VidModeSetModeValue()) are used only in xf86VidMode code and do not need to be available anywhere else. Remove these functions from the public VidMode API and move them as static where they are used. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: use appropriate DisplayModePtr typeOlivier Fourdan3-70/+70
The API uses an untyped pointer (void *) where a DisplayModePtr is expected. Clean up the API to use the appropriate type, as DisplayModePtr is really all that will be passed there. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: remove VidModeGetMonitor()Olivier Fourdan3-41/+30
VidModeGetMonitor() is used solely in ProcXF86VidModeGetMonitor() to get a untyped monitor pointer that is passed back straight again to VidModeGetMonitorValue(). This is actually useless as VidModeGetMonitorValue() could as well get the monitor from the ScreenPtr just like VidModeGetMonitor() does. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: use ScreenPtr instead of screen indexOlivier Fourdan3-168/+181
New code passes ScreenPtr instead of the screen index. Change the VidMode functions to take a ScreenPtr. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: get rid of the CloseScreen wrapperOlivier Fourdan2-18/+0
As we rely on dixRegisterPrivateKey() to allocate the memory for us that will be free automatically, we do not need the CloseScreen wrapper anymore. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29vidmode: use appropriate APIOlivier Fourdan1-21/+4
dixRegisterPrivateKey() can allocate memory that will be freed when the screen is teared down. No need to calloc() and free the memory ourself using a broken ref counting method. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
2016-02-29dri2: Allow many blocked clients per-drawableChris Wilson1-59/+71
This patch was motivated by the need to fix the use-after-free in dri2ClientWake, but in doing so removes an arbitrary restriction that limits DRI2 to only blocking the first client on each drawable. In order to fix the use-after-free, we need to avoid touching our privates in the ClientSleep callback and so we want to only use that external list as our means of controlling sleeps and wakeups. We thus have a list of sleeping clients at our disposal and can manage multiple events and sources. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-29dix: Add ClientSignalAll()Chris Wilson2-0/+30
This is a variant of ClientSignal() that signals all clients with an optional matching sleeping client, function and closure. Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-02-29xwin: Remove unhelpful debug about WM message queue sizeJon Turney1-38/+0
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Add SKIPTASKBAR hint to _NET_WM_WINDOW_TYPE_DOCK type windowsJon Turney1-1/+1
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: In multiwindow mode, look up the HWND for the parent windowJon Turney1-3/+7
Rather than only looking at the foreground window to see if it matches the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from the window privates. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Factor out MessageName() debug helperJon Turney1-68/+61
Factor out the MessageName() debug helper for message id -> text, and use it on message queue and dequeue. Reorder in numerical order to match winwindow.h Add missing WM_WM_ICON_EVENT Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Keyboard layout updatesJon Turney2-33/+45
layout zh_TW doesn't exist (anymore), try something else for that. layout it variant mac doesn't seem to exist anymore, try to handle Macintosh keyboards (running under Parallels on Mac) and other oddities in a more generic way, by falling back to matching only on the language identifer part of the input locale identifer. v2: Fix typo of 0xa0000 for 0xa000 Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Add a tentative entry for the Korean keyboard to the list of known ↵Colin Harrison1-0/+1
keyboard layouts Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-02-29xwin: Update to XRANDR 1.2 internal interface to ensure an output is ↵Jon Turney1-11/+81
reported by XRANDR If using the X server internal XRANDR 1.0 interface, it seems we must register a display size with RRRegisterSize() in order to make RRGetInfo() call RRScanOldConfig() to generate an output and crtc for us. Without this, the following GDM bug means that an XDMCP session to GDM cannot be started. https://bugzilla.gnome.org/show_bug.cgi?id=736054 Instead, use the more recent XRANDR 1.2 internal interface to explicitly create the output and crtc, and maintain a single mode which represents the current display size. Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done which has no effect, this seems to throw the GDM greeter into a loop... v2: Maintain reference count for the mode we maintain more correctly, to avoid double free causing a crash on shutdown Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't change anything, so we don't fail due to our lack of rrSetConfig or rrCrtcSet hooks. See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html v3: Raise limit on X display size from 4Kx4K to 32Kx32K Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Use WM_CLIPBOARDUPDATE clipboard APIJon Turney3-39/+87
Windows Vista and later have a saner clipboard API where the clipboard viewer linked list is no longer maintained by applications. Use it where available. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Check that window position is visible on non-rectangular virtual desktopsJon Turney1-8/+12
Improve the check that window position is visible to work correctly for non-rectangular virtual desktops Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Correctly interpret WM_HINTS, WM_NORMAL_HINTS properties on x86_64Jon Turney1-8/+20
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Improve handling of no-decoration motif hintJon Turney1-1/+1
When motif decoration hint asks for no decoration, don't add sysmenu, mimimize or maximimize controls. (This fixes a problem with e.g. fbpanel having a minimize control, but gtk's panel_configure_event() doesn't like the state we put the window into when we minimize it, causing it to spin) Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: XGetWMNormalHints() returns non-zero on successJon Turney1-2/+1
XGetWMNormalHints() doesn't actually return a Status value. On success it returns a non-zero value, not Success. Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29xwin: Fix format warnings when ./configured --enable-debug --enable-windowswmJon Turney4-12/+12
Fix format warnings (mainly pointer format fixes) which show up when ./configured --enable-debug --enable-windowswm Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>