Commit Graph

10866 Commits

Author SHA1 Message Date
Lennart Poettering
6cea28fe4b config: don't fail if a device vanished by the time we managed to look at it
The nature of hotplug is that a device we enumerated might already be
gone by the time we look at it, so don't assume otherwise.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:29:56 +10:00
Lennart Poettering
f13de9ca1b config: limit the kernel subsystems we look for devices in
Don't enumerate/monitor all devices of the system (since that can be
quite a few), but limit our search to devices from the "input"
subsystem, as well as the "tty" subsystem (to cover Wacom tablets).

This should make X start up a bit faster and reduce the number of
unnecessary wake-ups of the X server.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:29:49 +10:00
Lennart Poettering
882e3c2680 config: process udev "changed" and "add" events in the same code paths
udev gives no guarantee that before each "changed" event for a device
there's an "add" event, or that before each "remove" is an "add", or
that before each "add" there was no "add" already and so on. Users can
trigger these events at any time with "udevadm trigger", and netlink is
a lossy transport, hence the events can come in unexpected ordering.

With other words: regardless which event is generated, the X server must
not choke on it and make the best of it, hence make sure that if we get
an "add" event for an existing device we don't add the device a second
time.

Signed-off-by: Lennart Poettering <lennart@poettering.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-27 09:29:39 +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
Daniel Stone
82f5521a6d XKB: Work around broken interps from old xkbcomp
Bugfix for broken xkbcomp: if we encounter an XFree86Private action with
Any+AnyOfOrNone(All), then we skip the interp as broken.  Versions of
xkbcomp below 1.2.2 had a bug where they would interpret a symbol that
couldn't be found in an interpret as Any.  So, an
XF86LogWindowTree+AnyOfOrNone(All) interp that triggered the PrWins
action would make every key without an action trigger PrWins if libX11
didn't yet know about the XF86LogWindowTree keysym.  None too useful.

We only do this for XFree86 actions, as the current XKB dataset relies
on Any+AnyOfOrNone(All) -> SetMods for Ctrl in particular.

See xkbcomp commits 2a473b906943ffd807ad81960c47530ee7ae9a60 and
3caab5aa37decb7b5dc1642a0452efc3e1f5100e for more details.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Acked-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-15 15:44:19 +10:00
Daniel Stone
c177a5bcaa Fix non-Composite builds in PrintWindowTree
The previous patch accidentally introduced a hard dependency on
Composite.  Sorry, OS X.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reported-by: Jeremy Huddleston <jeremyhu@apple.com>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-15 15:44:06 +10:00
Keith Packard
01dbf2514a Merge remote-tracking branch 'jturney/master' 2011-07-13 11:44:15 -07:00
Gaetan Nadon
5a801af689 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: Keith Packard <keithp@keithp.com>
2011-07-13 11:20:41 -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
e084ac30b3 Input: Reset SD remainder when copying co-ords from MD
In updateSlaveDeviceCoords, pDev->last.valuators was being copied from
the master, but pDev->last.remainder wasn't.  Make sure we copy both, to
avoid minor inconsistencies.

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:28 +10:00
Peter Hutterer
23a7832789 input: add POINTER_NORAW to avoid generation of raw events (#30068)
RawEvents are supposed to be events coming from the driver. When warping the
pointer, this should not generate a raw event.

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

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-07-01 08:46:28 +10:00
Daniel Stone
9444e40d77 Test: Input: Only ever set up to MAX_VALUATORS valuators
Previously, the input tests were working up to sizeof(mask) * 8, which
could be more than the arrays; the latter only being sized as
MAX_VALUATORS.

Hypothetically, if you were switching the stored valuator values to
double instead of uint32_t, and you attempted to set the 39th member of
a MAX_VALUATORS-sized (36) array, you'd probably end up smashing
ev->key_repeat into oblivion and then tripping the check for invalid
flags because you haven't yet put XIPointerEmulated into the valid flags
for XI_Motion.  Probably.

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:28 +10:00
Daniel Stone
1e65a01cf7 Test: Ensure libxservertest gets relinked when necessary
Similar to how we link Xorg, make sure that whenever any of the
component libraries changes, we relink libxservertest and the tests.
Not much use testing anything other than the actual source in your tree.

Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Dan Nicholson <dbn.lists@gmail.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
Daniel Stone
ddf735fd4e DIX: Make PrintWindowTree actually useful
Rewrite PrintWindowTree to make it actually tell you what you want to
know.

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:15 +10:00
Matěj Cepl
b27d61e443 Fix UTF-8 encoding
Report to find out all non-UTF-8 files created by

cat extensions |xargs -I XXXX find . -name \*.XXXX |while read FILE ; do
    if ( iconv -f utf8 -t ucs2 $FILE >/dev/null 2>/dev/null ) ; then
        /bin/true
    else
        echo $FILE
    fi
done >>report

Signed-off-by: Matěj Cepl <mcepl@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>

[Daniel: git am failed for me, so I redid it.  The method listed in the
         commit message also failed, so I just used file/grep/iconv.  The
         results are the same though.]
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30 16:38:31 +10:00
Scott James Remnant
2ee85d954c dix: avoid calling deleted block and wakeup handlers
BlockHandler and WakeupHandlers may be removed within a different
BlockHandler or WakeupHandler, especially since config/udev uses
these and removes devices.

Calling the deleted handlers and passing potentially freed data
can result in the X server segfaulting after device removal, or
events that result in device removal such as undocking or suspend/
resume.

Signed-off-by: Scott James Remnant <scott@netsplit.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30 16:38:29 +10:00
Marcin Slusarz
b573cdd40e dri2: restore Screen->ConfigNotify on close
ConfigNotify is set by DRI2ScreenInit, but not restored to
previous state on close. Fix it.
(I'm preparing a patch for xf86-video-nouveau which detects GPU lockup
after dri2 init and it needs to reinitialize dri2)

Signed-off-by: Marcin Slusarz <marcin.slusarz@gmail.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-06-30 16:38:23 +10:00
Keith Packard
61f87a75f2 Merge remote-tracking branch 'jturney/master' 2011-06-29 20:14:51 -07:00
Keith Packard
0d2153a46c Merge remote-tracking branch 'jbarnes/master' 2011-06-29 20:08:32 -07:00
Gaetan Nadon
b631c39a21 Remove unused check for PERL program
Unable to find any use of the PERL Automake variable.
It was used in hw/xfree86/scanpci around 2005.
Should it ever be needed, use XORG_WITH_PERL macro.

Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
Signed-off-by: Keith Packard <keithp@keithp.com>
2011-06-29 19:03:46 -07:00
Keith Packard
d5ca33ca2d Merge remote-tracking branch 'kibi/master' 2011-06-29 18:54:33 -07:00
Yaakov Selkowitz
72d914335c Cygwin/X: Left-justify website link in About box
Left-justify website link in About box.  This is a cosmetic fix to make
the About box display correctly when Windows is configured with a
non-default DPI value

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
2011-06-29 19:14:38 +01:00
Jon TURNEY
e78628406f Cygwin/X: Preserve client area size and position on Windows window style change
When the style changes, adjust the window size so the client area remains the same.

Otherwise the window size may change when sizing is reflected from Windows to X, and
some windows are drawn expecting them to be exactly the requested size (e.g. the
gmplayer control window)

Use DeferWindowPos to delay the resize to preserve client area on WM_STYLECHANGING
until after the style change has actually happened in WM_STYLECHANGED

As a consquence of this, we need to be more careful to create windows with exactly
the requested placement and client area initially, so the client area matches what
the X client requested

Also synchronize the X windows idea of the placement of a window which Windows is
allowed to place

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
2011-06-29 19:14:35 +01:00
Jon TURNEY
1d7f3a0031 glx: Move GLX extension string utility functions
Move GLX extension string utility functions from the DRI1 convenience library
into the GLX extension convenience library, so other DDX which don't have DRI
can use them.

This is probably also needed if anyone actually tries to build an Xorg DDX
with only DRI2 support...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
2011-06-29 19:09:23 +01:00