summaryrefslogtreecommitdiff
path: root/hw
AgeCommit message (Collapse)AuthorFilesLines
2021-02-18xquartz: Fold away array_with_strings_and_numbers and simplify with more ↵Jeremy Huddleston Sequoia1-35/+15
modern Objective-C Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-18xqaurtz: Remove message_kit_thread() and use dispatch insteadJeremy Huddleston Sequoia1-92/+29
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-18xquartz: Use objc_autoreleasePoolPush / objc_autoreleasePoolPop directly in ↵Jeremy Huddleston Sequoia4-73/+33
QuartzBlockHandler It violates @autoreleasepool best practices, and this helps collapse quartzCocoa.m into quartz.c Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-18xquartz: Minor code modernization -- @autoreleasepool adoptionJeremy Huddleston Sequoia3-98/+78
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-18xquartz: Remove some dead code for compatibility with older nibsJeremy Huddleston Sequoia2-12/+0
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-18xquartz: Remove a workaround for AppKit versions older than LionJeremy Huddleston Sequoia1-10/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-17xquartz: Fix applications menu table background color for dark modeJeremy Huddleston Sequoia92-340/+401
Fixes: https://github.com/XQuartz/XQuartz/issues/32 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-17xquartz: Apply Xcode 12.4 automatic updates to nibsJeremy Huddleston Sequoia60-109564/+22615
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-17xquartz: Update the about box copyright to 2021Jeremy Huddleston Sequoia1-2/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-17xquartz: Ensure we call into TIS on the main threadJeremy Huddleston Sequoia1-11/+21
There is a place where this code was called on the main thread. We're using a rather nasty anti-pattern to just call a block inline rather than synchonously calling it on the main thread if we're already on the main thread. This code could use a good overhaul, but I don't have time to rip it apart right now. This will address the immediate issue. Fixes: https://github.com/XQuartz/XQuartz/issues/40 Fixes: https://github.com/XQuartz/XQuartz/issues/48 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-17xwayland: use get_pointer_device() for enter/leave handling tooPeter Hutterer1-11/+11
In Weston, clicking the window decoration of an Xwayland client gives us a wl_pointer.button event immediately followed by a wl_pointer.leave event. The leave event does not contain any button state information, so the button remains logically down in the DIX. Once the pointer button is released, a wl_pointer.enter event is sent with the current button state (zero). This needs to trigger a ButtonRelease event but for that we need to ensure that the device is the same as the one we send ButtonPress events through. Fixes a regression introduced in a4095162ca923992a8cfae6d0f09ff9f8144762a. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Olivier Fourdan <ofourdan@redhat.com>
2021-02-16xwayland: Add PtrFeedback to the touch deviceOlivier Fourdan1-0/+4
Trying to change the acceleration/threshold on Xwayland cannot work, and the corresponding handler xwl_pointer_control() is a no-op. Yet, an X11 client trying to change those on the touch device may possibly cause a crash because the touch device in Xwayland doesn't set that. Initialize the touch device's PtrFeedback to make sure that just cannot happen. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1137
2021-02-15xwayland: Use relative device for buttons/axisOlivier Fourdan1-2/+13
We are using the relative pointer for motion events, but buttons and axis events still go through the absolute pointer device. That means additional DeviceChanged events that could be avoided if the buttons and axis events were coming from the same device as motion events. Route those events to the relative pointer if available so that motion, buttons and axis events come from the same device (most of the time). Suggested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
2021-02-15xwayland: Add wheel axis to relative pointerOlivier Fourdan1-1/+10
The relative pointer only has 2 axis, if we want to route the mouse wheel events to that device, we need to add the axis definition, similar to what is done for the absolute pointer. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
2021-02-15xwayland: Split dispatch_pointer_motion_eventOlivier Fourdan1-62/+74
This is a cleanup patch, no functional change. Split the function dispatch_pointer_motion_event() into three separate simpler functions, relative motion with a warp emulator, relative motion and absolute motion. This makes the code a lot easier to read for me, rather than having everything in a single function with nested if/else conditions. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2021-02-15xwayland: Use relative values for raw eventsOlivier Fourdan1-18/+32
Xwayland supports relative motion events from the Wayland compositor via the relative-pointer protocol, and converts those to the absolute range in device units for raw events. Some X11 clients however wrongly assume relative values in the axis values even for devices explicitly labeled as absolute. While this is a bug in the client, such applications would work fine in plain Xorg but not with Xwayland. To avoid that issue, use the relative values for raw events without conversion, so that such application continue to work in Xwayland. Thanks Peter for figuring out the root cause. v2: Don't duplicate relative and absolute events (Peter) v3: Use POINTER_RAWONLY (Peter) Suggested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
2021-02-15xwayland: Use a resolution of 0 for relative motionOlivier Fourdan1-2/+2
That's what evdev/libinput drivers do. Suggested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
2021-02-15dix: Add POINTER_RAWONLY flagOlivier Fourdan1-1/+1
This add a new flag POINTER_RAWONLY for GetPointerEvents() which does pretty much the opposite of POINTER_NORAW. Basically, this tells GetPointerEvents() that we only want the DeviceChanged events and any raw events for this motion but no actual motion events. This is preliminary work for Xwayland to be able to use relative motion events for raw events. Xwayland would use absolute events for raw events, but some X11 clients (wrongly) assume raw events to be always relative. To allow such clients to work with Xwayland, it needs to switch to relative raw events (if those are available from the Wayland compositor). However, Xwayland cannot use relative motion events for actual pointer location because that would cause a drift over time, the pointer being actually controlled by the Wayland compositor. So Xwayland needs to be able to send only relative raw events, hence this API. Bump the ABI_XINPUT_VERSION minor version to reflect that API addition. v2: Actually avoid sending motion events (Peter) v3: Keep sending raw emulated events with RAWONLY (Peter) Suggested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Related: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1130
2021-02-02xwayland: Translate keyboard grabs on the root windowOlivier Fourdan1-2/+28
When an X11 client issues an active grab on the keyboard, Xwayland forward this to the Wayland compositor using the Xwayland specific protocol "xwayland-keyboard-grab" if it can find the corresponding Xwayland window. Some X11 clients (typically older games) however try to issue the keyboard grab on the X11 root window, which has obviously no matching Xwayland window. In such a case, the grab is simply ignored and the game will not work as expected. To workaround that issue, if an X11 client issues a keyboard grab on the root window, Xwayland will search for a toplevel window belonging to the same X11 client that it can use as the grab window instead. This way, the grab can be forwarded to the Wayland compositor that can either grant or deny the request based on the window and its internal policies. The heuristic picks the first realized toplevel window belonging to the client so that the Wayland compositor will send it the keyboard events, and the Xserver grab mechanism will then take care of routing the events to the expected X11 window by itself. v2: Make the test more clear (Dor Askayo <dor.askayo@gmail.com>) Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Jonas Ådahl <jadahl@gmail.com> See-also: https://gitlab.gnome.org/GNOME/mutter/-/issues/1249
2021-02-02xquartz: Ensure that NSRunAlertPanel() is run on the main threadJeremy Huddleston Sequoia1-6/+9
Fixes: https://github.com/XQuartz/XQuartz/issues/30 Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for older versions of libXpluginJeremy Huddleston Sequoia4-52/+4
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove unused include of AvailabilityMacros.h from various sourcesJeremy Huddleston Sequoia9-14/+0
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for building for i386Jeremy Huddleston Sequoia3-170/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for Mountain Lion and earlier versions of macOSJeremy Huddleston Sequoia2-17/+9
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for Lion and earlier versions of macOSJeremy Huddleston Sequoia5-409/+4
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for SnowLeopard and earlier versions of macOSJeremy Huddleston Sequoia1-4/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove check for libdispatch now that we don't support pre-SnowLeopardJeremy Huddleston Sequoia5-222/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for Leopard and earlier versions of macOSJeremy Huddleston Sequoia5-173/+1
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for Tiger and earlier versions of macOSJeremy Huddleston Sequoia7-95/+7
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01xquartz: Remove support for Panther and earlier versions of macOSJeremy Huddleston Sequoia1-8/+2
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
2021-02-01Fix typo "XQaurtz" in Xquartz.manJim DeLaHunt1-1/+1
2021-01-29mi: List extensions in usage messageOlivier Fourdan16-6/+23
Not all extensions can be enabled or disabled at runtime, list the extensions which can from the help message rather than on error only. v2: * Print the header message in the ListStaticExtensions() (Peter Hutterer) * Do not export ListStaticExtensions() as Xserver API Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2021-01-29xwayland: Add -verbose option as in xfree86Misha Gusarov3-0/+27
Makes it easier to debug Xwayland problems. Signed-off-by: Misha Gusarov <dottedmag@dottedmag.net>
2021-01-27compiler.h: don't define inb/outb and friends on mipsJulien Cristau2-6/+5
The definition relies on IOPortBase, which is only ever set in hw/xfree86/os-support/bsd/arm_video.c This caused build failures on linux/mips with GCC 10, due to this change (from https://gcc.gnu.org/gcc-10/changes.html#c): "GCC now defaults to -fno-common. As a result, global variable accesses are more efficient on various targets. In C, global variables with multiple tentative definitions now result in linker errors. With -fcommon such definitions are silently merged during linking." As a result anything including compiler.h would get its own definition of IOPortBase and the linker would error out.
2021-01-22xwayland: Add new pkg-config variable for listenfdOlivier Fourdan1-0/+1
Since commit b3f3d65e, xwayland now supports the command line option "-listenfd" for passing file descriptors and marked "-listen" as deprecated for this specific purpose. Add a new pkg-config variable "have_listenfd" to the xwayland.pc so that compositors can know this is available and use listenfd in place of the deprecated option. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
2021-01-08xwayland: remove unused parameter of xwl_glamor_pixmap_get_wl_bufferErik Kurzinger6-23/+9
There are currently no callers that make use of the "created" output parameter of xwl_glamor_pixmap_get_wl_buffer. Remove it, along with the corresponding argument of the associated EGL backend entrypoint.
2021-01-06xfree86/inputtest: Drop extraneous linux-specific includePovilas Kanapickas1-1/+0
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-12-18xfree86: Use different scroll increment than libinput in inputtest drvPovilas Kanapickas1-6/+6
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-12-17xfree86: Add scroll axes to touch devices in inputtest driverPovilas Kanapickas2-18/+20
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-12-17xfree86: Add support for pressure valuator axis in inputtest driverPovilas Kanapickas2-1/+25
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-12-17xfree86: Fix axis labels for PointerAbsolute input of inputtest driverPovilas Kanapickas1-7/+17
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-12-15xwayland: Remove unneeded variableOlivier Fourdan1-3/+1
Just a small code cleanup, there is no need to allocate a variable only to check the return value of eglInitialize(). Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Tony Lindgren <tony@atomide.com>
2020-12-15xwayland: Refactor glamor EGL initOlivier Fourdan1-60/+89
Glamor requires at least big GL 2.1 or GLES2, therefore Xwayland tries to initialize first GL and then GLES2 if that fails. It does that all in one single function which makes the code slightly complicated, move the initialization of big-GL and GLES2 to separate functions to help with readability of the code. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Reviewed-by: Tony Lindgren <tony@atomide.com>
2020-12-14xwayland: fix GL version check for GLES only devicesTony Lindgren1-12/+14
We currently bail out early for GLES only devices, and call epoxy_gl_version() too early for GLES only that will make GLES only devices return NULL for glGetString(GL_RENDERER). Let's also add a check to see if we need to recreate the context to avoid pointless warnings for GLES only devices as suggested by Olivier Fourdan <ofourdan@redhat.com>. Fixes: a506b4ec - xwayland: make context current to check GL version Signed-off-by: Tony Lindgren <tony@atomide.com>
2020-12-14xfree86: Implement a test input driverPovilas Kanapickas7-0/+1356
Signed-off-by: Povilas Kanapickas <povilas@radix.lt>
2020-12-10xwayland: Hold window buffer until releasedOlivier Fourdan1-1/+24
The window buffer mechanism would free the pixmap and its corresponding Wayland buffer as soon as window buffers are disposed. Typically when the X11 window is unrealized, the current window buffer is still used by the Wayland compositor and yet Xwayland will destroy the buffer. As a matter of fact, Xwayland should not destroy the Wayland buffer before the wl_buffer.release event is received. Add a reference counter to the window buffer similar to the to pixmap reference counter to keep the buffer around until the release callback is received. Increase that reference counter on the buffer which will be attached to the surface, and drop that reference when receiving the release callback notification. v2: Use a specific reference counter on the buffer rather than relying on the pixmap refcnt (Michel Dänzer <mdaenzer@redhat.com>) Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com> Acked-by: Martin Peres <martin.peres@mupuf.org>
2020-12-10xwayland: Hold cursor buffer until releasedOlivier Fourdan1-0/+14
The cursor code would destroy the buffer as soon as the cursor is unrealized on X11 side. Yet, the Wayland compositor may still be using the buffer as long as a released callback has not been received. Increase the reference counter on the pixmap to hold a reference on the pixmap when attaching it to the surface and use the new pixmap release callback mechanism to release that reference when the buffer is released. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Acked-by: Martin Peres <martin.peres@mupuf.org> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2020-12-10xwayland: Factorize common cursor codeOlivier Fourdan1-32/+33
The seat and tablet cursor functions are very similar, factorize the commonalities to simplify the code and reduce the copy/paste. Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
2020-12-08Remove check for useSIGIO optionPrabhu Sundararaj2-7/+0
Commit 6a5a4e60373c1386b311b2a8bb666c32d68a9d99 removed the option to configure useSIGIO option. Indeed, the xfree86 SIGIO support was reworked to use internal versions of OsBlockSIGIO and OsReleaseSIGIO. As a result, useSIGIO is no longer needed and can dropped Fixes: 6a5a4e60 - Remove SIGIO support for input [v5] Closes: xorg/xserver#1107 Reviewed-by: Adam Jackson <ajax@redhat.com> Signed-off-by: Prabhu Sundararaj <prabhu.sundararaj@nxp.com> Signed-off-by: Mylène Josserand <mylene.josserand@free-electrons.com> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
2020-12-08xwayland: Replace LogMessage with LogMessageVerbMariusz Ceier2-4/+4
LogMessage logs only when the XLOG_VERBOSITY is >= 1, but by default XLOG_VERBOSITY is 0, so for example warning about deprected -listen parameter is never shown when running "Xwayland -listen 32 -help". Signed-off-by: Mariusz Ceier <mceier+freedesktop@gmail.com>