Commit Graph

5470 Commits

Author SHA1 Message Date
Peter Hutterer
79ca7c0b57 xfree86: comment typo fix
in synch → in sync

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:53 +10:00
Peter Hutterer
1357cd7251 Revert "Attempt to add the 'mouse' driver in more situations."
This reverts commit 43d9edd31e.

This commit was introduced in the 1.2 cycle when hotplugging was less than
ideal (i.e. it didn't exist). From the commit message:

    Always add a mouse driver instance configured to send core events, unless
    a core pointer already exists using either the mouse or void drivers.  This
    handles the laptop case where the config file only specifies, say,
    synaptics, which causes the touchpad to work but not the pointing stick.
    We don't double-instantiate the mouse driver to avoid the mouse moving twice
    as fast, and we skip this logic when the user asked for a void core pointer
    since that probably means they want to run with no pointer at all.

To get this case above, a user would need to disable hotplugging _and_ have a
xorg.conf that only references one device. This is possible, but not a use-case
we should worry about too much now.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Lennart Poettering
159b03e137 config: add udev/systemd multi-seat support
Add support for multi-seat-aware input device hotplugging. This
implements the multi-seat scheme explained here:

http://www.freedesktop.org/wiki/Software/systemd/multiseat

This introduces a new X server switch "-seat" which allows configuration
of the seat to enumerate hotplugging devices on. If specified the value
of this parameter will also be exported as root window property
Xorg_Seat.

To properly support input hotplugging devices need to be tagged in udev
according to the seat they are on. Untagged devices are assumed to be on
the default seat "seat0". If no "-seat" parameter is passed only devices
on "seat0" are used. This means that the new scheme is perfectly
compatible with existing setups which have no tagged input devices.

Note that the -seat switch takes a completely generic identifier, and
that it has no effect on non-Linux systems. In fact, on other OSes a
completely different identifier scheme for seats could be used but still
be exposed with the Xorg_Seat and -seat.

I tried to follow the coding style of the surrounding code blocks if
there was any one could follow.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:49 +10:00
Peter Hutterer
95772598b5 xfree86: use xf86AllocateInput for implicit devices too
Slowly merging the vastly different code-paths.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Peter Hutterer
fa8f465281 xfree86: factor out adding/removing a device from the input device array
No functional changes, just readability improvements. This also gets rid of
the count variable. Count was just used for resizing the null-terminated
list. Since we're not in a time-critical path here at all we can afford to
loop the list multiple times instead of keeping an extra variable around.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:49 +10:00
Peter Hutterer
5b5477c05f xfree86: update comment for InitInput
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
7354f60783 xfree86: nest loops instead of 0x1 pointers.
If we find the core device, move all other device pointers forward right
then and there. The break will jump out of the top loop.

They had a special on braces today, so I added some for readability (and
fixed up tab vs space indentation.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
5669aa2d24 xfree86: improve readability of synthesized device.
No functional changes.

The options we assign are the ones from the Pointer/Keyboard device so we
might as well use those readable names instead of dev[count-1]->options.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:48 +10:00
Peter Hutterer
4527e2b776 xfree86: when implicitly choosing a core device, set the option to a value
Devices are core pointers/keyboards by default now anyway, but let's set the
option to some value instead of just NULL.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:47 +10:00
Peter Hutterer
44d53728a6 xfree86: don't warn about duplicate core devices
It doesn't matter. All devices are core pointer devices by default now
anyway.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-08-22 15:56:47 +10:00
Daniel Kurtz
033f53c223 xf86Helper: use LogHdrMessageVerb in xf86VDrvMsgVerb
LogHdrMessageVerb allows passing a parameterized header to insert in a log
message between MessageType and the formatted message body string.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:56:44 +10:00
Daniel Kurtz
cd8ee3e5cb xf86Helper: use LogHdrMessageVerb in xf86VIDrvMsgVerb
LogHdrMessageVerb allows passing a parameterized header to insert in a log
message between MessageType and the formatted message body string.

Signed-off-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-08-22 15:49:25 +10:00
Julien Cristau
a1dec7cd6a Xephyr/dri: register screen and window privates on init
Fixes assertion failure when calling dixSetPrivate
Debian bug#632549 <http://bugs.debian.org/632549>

Reported-and-tested-by: Mohammed Sameer <msameer@foolab.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-08-09 13:51:21 -07:00
Julien Cristau
e87adcc9e0 Xquartz: include new localization files in the tarball
Signed-off-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 16:45:55 -07:00
Jeremy Huddleston
a1bb5062c7 XQuartz: xpr: Don't FatalError if xp_unlock_window fails
We added the FatalError in 5d1d9d9ae3 but
it caused a regression http://xquartz.macosforge.org/trac/ticket/482

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 16:44:56 -07:00
Jeremy Huddleston
c319f7b5b3 XQuartz: Use CFSTR to avoid implicit cast warning of NSString * to CFStringRef
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-31 16:44:55 -07:00
Keith Packard
b8f61c11c9 Merge remote-tracking branch 'whot/for-keith' 2011-07-29 14:58:58 -07:00
Peter Hutterer
f51e42f583 Terminate the log with one last message.
Instead of just closing the log when everything is done, put one more
message in stating that we're actually terminating. Users or scripts that
look at the Xorg.log will then know that a) the server has terminated
properly and b) why the server terminated (to some degree, given that most
real-world errors will be caused by AbortServer()).

Acked-by: Gaetan Nadon <memsize@videotron.ca>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:31:02 +10:00
Peter Hutterer
3798dd379c Initialize the fd to -1 for xorg.conf input devices.
For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf
path is different. Since not all drivers reset the fd during PreInit but may
still call close(pInfo->fd) in all cases, this can terminate the logging
early.

Reproducible: add a wacom driver InputDevice section with no Option Device.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:02 +10:00
Peter Hutterer
f2a6735cfc xfree86: NULL option values are technically valid, don't strdup them
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:02 +10:00
Peter Hutterer
f0d7e9db28 xfree86: duplicate xorg.conf device information before xf86NewInputDevice
xf86ConfigLayout.inputs contains the information from the xorg.conf
file. Passing this into xf86NewInputDevice means the device will get
cleaned up on exit and the pointers in xf86ConfigLayout.inputs are left
dangling. In the second server generation, this results in a server
crash.

Also, rename pDev to pInfo. pDev is pretty much reserved for DeviceIntPtr
types.

Reproducible: AutoAddDevices off and xorg.conf input sections, trigger
server regeneration.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:02 +10:00
Peter Hutterer
8ffddbcf72 xfree86: Remove devices that failed to enable on startup
Devices that succeeded during PreInit and DEVICE_INIT but failed in
DEVICE_ON would be deleted through xf86DeleteInput but not removed from the
list of input devices (and not turned off). The result was a double free on
server shutdown.

Fix this by calling RemoveDevice if EnableDevice fails.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2011-07-27 09:31:01 +10:00
Jon TURNEY
5596f10cce Remove hw/xwin/xlaunch
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-07-26 14:28:57 +01:00
Jeremy Huddleston
73864a87aa XQuartz: Localization updates
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19 20:04:17 -07:00
Jeremy Huddleston
d2463df84d XQuartz: Add english NIB changes for scroll_in_device_direction
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19 20:04:17 -07:00
Jeremy Huddleston
e36e7ad631 XQuartz: Add GUI controls to toggle scroll_in_device_direction
Also cleaned up the wording for fullscreen_menu.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19 20:01:11 -07:00
Jeremy Huddleston
ac43984215 XQuartz: Add a scroll_in_device_direction preference
This preference allows users to override the related option in Mac OS X's
Mouse/Trackpad preferences.  This effectively lets the user determine
which "context" all of X11 fits into for context-based scrolling until
such API exists within X11 itself to pass along to X11 clients.

This is applicable to Mav OS X 10.7+

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19 20:00:27 -07:00
George Staplin
ec95a9c829 XQuartz: Add diagnostic error checking to xp_destroy_surface.
This occurred to me in hindsight after the last commit.  If the
original developer had done this, we would have noticed the
problem sooner.
(cherry picked from commit aa0a57996f)
2011-07-19 19:49:48 -07:00
George Staplin
4fe7df2653 XQuartz: Fix a memory leak with surfaces that a new test found.
xp_destroy_surface was called with a surface id of 0, due to some
premature cleanup that set it to 0.  This means the surfaces
weren't being destroyed until the window was.

The code that did that was: pDRIDrawablePriv->sid = 0;

In long running applications this leak may or may not have been
harmful.  With the old libGL the surfaces weren't destroyed until
the context was destroyed or a new context created.  In the new
libGL they are reference counted, and released much sooner, so we
ran into a resource leak more noticeably with some tests.

Make the Apple DRI code dispatch events to the client(s) for
destroyed surfaces, when a resource is destroyed.  This seems to
work in my tests, however this clearly wasn't working for a while,
so bugs may result in the future if it enables some new (unexpected)
side effects.

Also add a few helpful comments to aid in understanding the code
in the future.

Tested with the test suite, Pymol, and various Mesa demos.
(cherry picked from commit bede83eb19)
2011-07-19 19:49:47 -07:00
Jeremy Huddleston
0ebe45a717 XQuartz: DRI: Dead code removal
Also add some comments that weren't merged in from server-1.4-apple's
99babae132

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-19 19:49:45 -07:00
Jeremy Huddleston
88ad050f3c XQuartz: Add some sanity checking and a fallback for the bundle id.
This way we'll print an error and still mostly work rather than crashing if
someone installs XQuartz.app incorrectly or tries running the server within
the build system rather than the installed system.

Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-18 22:54:21 -07:00
Jeremy Huddleston
89bfa0c633 XQuartz: DarwinEQFini doesn't return Bool
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
2011-07-15 10:40:12 -07:00
Gaetan Nadon
af0fbc37e3 XWinrc: replace hard coded section number with __filemansuffix__
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:12:55 +01:00
Jon TURNEY
42bc198775 glx: Remove a few lingering traces of __GLXscreen.GLXVersion
The GLXversion member of the __GLXscreen struct
is just cruft since commit ad5c0d9efa,
when we started returning the minimum GLX version supported by all
of the screens on the display, rather than the maximum version supported
by the server.

Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:09:21 +01:00
Jon TURNEY
005e68ba59 hw/xwin: Add -wgl option to XWin manpage
Document the -[no]wgl options in the XWin manpage

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:03:46 +01:00
Jon TURNEY
d62726019e hw/xwin: Add items to WGL AIGLX todo
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:03:45 +01:00
Jon TURNEY
276735ef5d hw/xwin: Report Window XIDs in Window debug messages
Report Window XIDs in Window create/destroy/reparent debug messages

It's actually quite useful if you are trying to corrolate those events
with what a client is doing...

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:03:43 +01:00
Jon TURNEY
b0b54338e2 hw/xwin: Add a flag to track which windows have been drawn to using WGL.
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:03:42 +01:00
Colin Harrison
98c6d91a48 hw/xwin/glx: Fix some warnings in generated wrapper code
Add a suitable cast to the generated code for glWinSetupDispatchTable()
so it doesn't generate screeds of warnings

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:03:21 +01:00
Jon TURNEY
b67e80c84e hw/xwin/glx: Handle failure to get any fbconfigs more gracefully.
Handle failure to get any useful pixel formats for GLX fbconfigs
more gracefully:  If we didn't get any useful pixel formats from
wglGetPixelFormatAttribivARB(), fall back to using DescribePixelFormat().
If that doesn't give us any useful pixel formats, fallback to software
rendering.

This works around a problem with Intel 845G drivers, where
wglGetPixelFormatAttribivARB() doesn't seem to work as we expect it to...

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:00:36 +01:00
Jon TURNEY
9915b16923 hw/xwin/glx: Don't spam log with wglwrap symbol resolution status at startup
... instead just log if an attempt is made to call a wrapper for
a function which didn't resolve

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:00:34 +01:00
Jon TURNEY
8216316867 hw/xwin/glx: Better handling of SetPixelFormat() failure
Propagate and report the failure if SetPixelFormat() fails

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:00:32 +01:00
Jon TURNEY
eecc8e06eb hw/xwin/glx: Improvements to glxWinErrorMessage() reporting in WGL GLX provider
Request the message using languageID 0 (best effort), rather than only using language neutral messages
Always report the numeric error code.
Trim any trailing \r from FormatMessage() output

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:00:31 +01:00
Jon TURNEY
3873be16d0 hw/xwin/glx: Fix fbconfig dumper formatting for 3 digit index numbers
Some graphics hardware supports hundreds of pixel formats, so adjust
formatting in fbconfig dumper for 3 digit index numbers

Also report the PFD_SUPPORT_DIRECTDRAW, PFD_DIRECT3D_ACCELERATED and
PFD_SUPPORT_COMPOSITION flags introduced with aero

Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07 18:00:29 +01:00
Keith Packard
d4096abb59 Merge remote-tracking branch 'whot/for-keith' 2011-07-01 15:45:45 -07:00
Peter Hutterer
87d4f90bfc input: free the EQ allocated memory on shutdown (#38634)
mieqFini() already does the right thing, but it needs to be called by the
various DDXs and the XTest Extension.

X.Org Bug 38634 <http://bugs.freedesktop.org/show_bug.cgi?id=38634>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Acked-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:28 +10:00
Daniel Stone
0f41d6c851 KDrive: Remove useless miPointerUpdateSprite call
miPointerUpdateSprite is already called from mieqProcessInputEvents, so
calling it by hand immediately after isn't massively helpful.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:27 +10:00
Daniel Stone
57b767d292 DMX: Remove useless miPointerUpdateSprite call
miPointerUpdateSprite is already called from mieqProcessInputEvents, so
calling it by hand immediately after isn't massively helpful.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:27 +10:00
Daniel Stone
cf398755c0 XWin: Remove executable bit from headers
Headers don't really need to be mode 0755.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Cyril Brulebois <kibi@debian.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:27 +10:00
Daniel Stone
7d2543a3cb XKB: Add debug key actions for grabs & window tree
Add four new private XKB actions for debugging:
    * PrGrbs: print active grabs to the log file
    * Ungrab: ungrab all currently active grabs
    * ClsGrb: kill clients with active grabs
    * PrWins: dump the current window tree to the log file

To use these, you need to modify your XKB maps, e.g. the following to
have Ctrl+Alt+(F9-F12) mapped to the above:
 - compat/xfree86:
    interpret XF86LogGrabInfo {
        action = Private(type=0x86, data="PrGrbs");
    };
    interpret XF86Ungrab {
        action = Private(type=0x86, data="Ungrab");
    }
    interpret XF86ClearGrab {
        action = Private(type=0x86, data="ClsGrb");
    }
    interpret XF86LogWindowTree {
        action = Private(type=0x86, data="PrWins");
    }

 - symbols/pc:
    key <FK09> {        type="CTRL+ALT", [ Return, XF86LogGrabInfo      ]   };
    key <FK10> {        type="CTRL+ALT", [ Return, XF86Ungrab           ]   };
    key <FK11> {        type="CTRL+ALT", [ Return, XF86ClearGrab        ]   };
    key <FK12> {        type="CTRL+ALT", [ Return, XF86LogWindowTree    ]   };

At the moment, this only works if the grabbing client continues to call
AllowEvents, as the server does no event processing at all when a device
is frozen.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:20 +10:00