summaryrefslogtreecommitdiff
path: root/hw/xwin
AgeCommit message (Collapse)AuthorFilesLines
2012-03-27Introduce a consistent coding styleKeith Packard82-26576/+24887
This is strictly the application of the script 'x-indent-all.sh' from util/modular. Compared to the patch that Daniel posted in January, I've added a few indent flags: -bap -psl -T PrivatePtr -T pmWait -T _XFUNCPROTOBEGIN -T _XFUNCPROTOEND -T _X_EXPORT The typedefs were needed to make the output of sdksyms.sh match the previous output, otherwise, the code is formatted badly enough that sdksyms.sh generates incorrect output. The generated code was compared with the previous version and found to be essentially identical -- "assert" line numbers and BUILD_TIME were the only differences found. The comparison was done with this script: dir1=$1 dir2=$2 for dir in $dir1 $dir2; do (cd $dir && find . -name '*.o' | while read file; do dir=`dirname $file` base=`basename $file .o` dump=$dir/$base.dump objdump -d $file > $dump done) done find $dir1 -name '*.dump' | while read dump; do otherdump=`echo $dump | sed "s;$dir1;$dir2;"` diff -u $dump $otherdump done Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Daniel Stone <daniel@fooishbar.org> Acked-by: Alan Coopersmith <alan.coopersmith@oracle.com> (cherry picked from commit 9838b7032ea9792bec21af424c53c07078636d21)
2012-01-27hw/xwin: Fix spelling of 'Canadian' in winkeybd.hColin Harrison1-1/+1
The Mounties always get their typo Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-27hw/xwin: Fix winEnqueueMotion() for change in miPointerSetPosition()Colin Harrison1-3/+0
Commit 3b36fd1b49030ead44358945f62e5abe7f4609ce changed miPointerSetPosition() to take co-ordinates as doubles, not ints, so this code as it stands is now wrong (if it ever was correct in the first place :-)) It's unclear that we can safely promote x,y to doubles, apply miPointerSetPosition() which potentially constrains the cursor, and then convert back to ints. Fortunately, this whole dance seems to be unnecessary, and we can simply remove the call to miPointerSetPosition() entirely, and just QueuePointerEvents() like any other input driver. Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-26hw/xwin: Ignore WM_DISPLAYCHANGE messages with 0 bppColin Harrison1-0/+4
Ignore WM_DISPLAYCHANGE messages which indicate bpp is changing to 0. That has no defined meaning I can find, but some graphics card drivers appear to generate it on suspend/resume or screensaver activate/deactivate. Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-26hw/xwin: Avoid WIN_WINDOW_PROP races during Windows window destructionJon TURNEY2-5/+5
The WIN_WINDOW_PROP is removed during WM_DESTROY handling, so it is not neccessary to remove it in winDestroyWindowsWindow(), and doing so opens a race condition, as we may attempt to access that property in the wndproc before the WM_DESTROY has completed. A specific example of that race is if a WM_KILLFOCUS occurs in the window between property removal and WM_DESTROY processing, where we will attempt to apply DeleteWindowFromAnyEvents() on an invalid (null) WindowPtr. Also guard against null WindowPtr in the WM_KILLFOCUS handler See http://cygwin.com/ml/cygwin-xfree/2012-01/msg00009.html Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Handle more motif window decoration hintingJon TURNEY2-4/+25
Handle the MWM_DECOR_MINIMIZE, MWM_DECOR_MAXIMIZE and MWM_DECOR_MENU decoration hints in a _MOTIF_WM_HINTS window property Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Fix AltGr key sometimes firing an additional Ctrl-L keyOliver Schmidt2-43/+60
I also had problems with the AltGr key. These could reliably be reproduced by holding the AltGr for some seconds (causing Windows generating auto repeat events) I discovered that the mechanism in winkeybd.c function winIsFakeCtrl_L had a problem if PeekMessage cannot obtain the next Alt_R message because it is not there yet. I prepared a patch that remembers the last Ctrl_L event and reacts on a later Alt_R. It was also necessary to alter the order in winWindowProc() in winwndproc.c: the invocation of winIsFakeCtrl_L had to be done before discarding auto-repeated key presses, as winIsFakeCtrl_L() now has an internal state which must be updated by all key events. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Handle the virtual key code generated by the Fn key on IBM Lenovo ↵Jon TURNEY2-2/+4
laptops Apparently, IBM Leonovo laptops can generate a key-press event for the Fn key, with virtual key code 0xFF and scan code extended 0x63 Handle this specially, rather than just passing on key code 0x63 (delete), so you don't delete what you just typed when you adjust the screen brightness, etc. :-) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: turn on -emulate3buttons if less than 3 mouse buttons are reportedJon TURNEY5-5/+46
Try to be more intelligent with default options, turn on -emulate3buttons by default if less than 3 mouse buttons are reported by Windows Also, add -noemulate3buttons option so this default setting can be reversed if desired Also, correctly report the number of mouse buttons windows is reporting, rather than always at least 3 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: In multiwindow mode, don't grab native input focus for new windows ↵Jon TURNEY2-1/+26
which hint they don't want it In multiwindow mode, avoid grabbing the input focus for newly created windows which have InputHint FALSE (this is used by e.g. glean to avoid every test window grabbing the focus) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Remove some redundant OS version reportingJon TURNEY3-18/+2
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Don't assume we'll always have converted the clipboard selection ↵Roland Cassard1-19/+4
after 2 attempts Rather than knowing we have to call winProcessXEventsTimeout() for up to 2 WIN_XEVENTS_CONVERT messages, process all messages in winProcessXEventsTimeout() until either: (i) the time out expired, (ii) an error occurred, or (iii) received a WIN_XEVENTS_NOTIFY messaage indicating the data has been to put on the clipboard. Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Mitigate a race condition in clipboard thread initializationMichel Hummel1-2/+0
Remove the variables g_fClipboardLaunched and g_fClipboardStarted from winInitializeGlobals(), as their re-initialization is handled in the file hw/xwin/InitOutput.c. Re-initializing g_fClipboardLaunched and g_fClipboardStarted during the server reset procedure can lead to the clipboard thread being launched two times and sometimes leads to a crash of the X server... Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Chain IOError handlers to avoid longjmp across threadsJon TURNEY2-25/+52
Avoid crashes on shutdown due to the undefined behaviour of calling longjmp() on the result of setjmp() from a different thread, by chaining IOError handlers and only jumping back up to the frame for this thread Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Improve XWinrc loading and error recoveryYaakov Selkowitz2-19/+65
If $HOME/.XWinrc is present but badly formed, ignore it and try system.XWinrc instead. If neither file is present or both are badly formed, provide a built-in default which gives the user the chance to load their new or fixed configuration without restarting. 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>
2012-01-26hw/xwin: Remove no-longer needed tricks used to prevent the clipboard client ↵Michel Hummel2-125/+3
from being killed Remove no-longer needed tricks used to hide the clipboard client from XDM to prevent it from being killed - Delete XQuery wrapper used to hide clipboard client - Delete XDMCP mode heuristic which waits until some magic number of connections have been established before starting the clipboard We still need the EstablishConnection wrapper to ensure that the clipboard client isn't the first client (causing a server restart if it disconnects) Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Automatically restart clipboard threadMichel Hummel2-8/+62
Automatically restart clipboard thread on unexpected exit Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26hw/xwin: Give the X window for the clipboard integration client a nameJon TURNEY1-0/+2
This makes it a bit easier to find when staring at the output of 'xwininfo -tree -root' Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-12Revert "dix: Pull client-is-local flag up to the ClientRec"Keith Packard1-2/+2
This reverts commit 49d38b75c8f3276cfce33ffe6b8c4fbeb1081b96. ABI change pended for 1.13
2012-01-09Merge remote-tracking branch 'jturney/rpavlik-xwin-fixes'Keith Packard11-25/+23
2012-01-07hw/xwin: Include manifest file in the dist tarballRyan Pavlik1-1/+2
Commit c02638fd added the manifest file, but didn't add it to EXTRA_DIST. Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGWRyan Pavlik2-1/+2
hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGW but still provide it if building for Win32 without autotools xserver/hw/xwin/winclipboard.h:42:0: warning: "HAS_WINSOCK" redefined ../../include/xwin-config.h:11:0: note: this is the location of the previous definition Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix possible null ptr deref in winMWExtWMDecorateWindow()Ryan Pavlik1-1/+2
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix possible null ptr deref in winMWExtWMRestackFrame()Ryan Pavlik1-1/+1
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix possible null ptr deref in winActivateAppPrimaryDD()Ryan Pavlik1-3/+3
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix possible null ptr deref in winActivateAppNativeGDI()Ryan Pavlik1-3/+4
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Clarify an if statement mixed with ifdef in winSetEngine()Ryan Pavlik1-5/+2
Use the same pattern as elsewhere so it's a bit clearer what we are checking Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix rrScreenSetSize function pointer mismatchRyan Pavlik1-2/+0
winrandr.c: In function ‘winRandRInit’: winrandr.c:218:31: warning: assignment from incompatible pointer type Fix winRandRScreenSetSize() function signature to match RRScreenSetSizeProcPtr type, to align with commit fd9331f6 'Revert "Separate out screen size and screen pixmap sizes in RRScreenSizeSet"' This is fall-out from the late revert of RANDR 1.4 in the 1.10 release cycle, it will probably need to be reverted if/when that goes back in again. Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Remove an empty #if 0/#endifRyan Pavlik1-2/+0
Um... yeah Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix double-free in error path in winQueryRGBBitsAndMasks()Ryan Pavlik1-1/+0
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-07hw/xwin: Fix a memory leak in error path in winInitWM()Ryan Pavlik1-5/+7
Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu> Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-01-06dix: Pull client-is-local flag up to the ClientRecAdam Jackson1-2/+2
Reviewed-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Adam Jackson <ajax@redhat.com>
2011-12-05Move to autoconf standard function name checks & definesAlan Coopersmith1-2/+2
Replace multiple methods of checking for functions with AC_CHECK_FUNCS Replace multiple methods of selecting fallback funcs with AC_REPLACE_FUNCS Replace HAS_* and NEED_* #defines with autogenerated HAVE_* Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Adam Jackson <ajax@redhat.com> Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net> Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2011-11-24Correctly free config file namesPaulo Zanoni1-1/+3
We call xf86penConfigDirFiles twice, so we overwrite the configDirPath variable, losing the pointer. If we move the pointer management to the upper layer (the function callers), they will be able to call these functions as many times as they want, but they'll have to free those returned values. v2: don't leak inside XWin 4,097 bytes in 1 blocks are definitely lost in loss record 625 of 632 at 0x4C2779D: malloc (in vgpreload_memcheck-amd64-linux.so) by 0x4D7899: DoSubstitution (scan.c:615) by 0x4D87B0: OpenConfigDir (scan.c:845) by 0x4D8A2D: xf86openConfigDirFiles (scan.c:955) by 0x49031F: xf86HandleConfigFile (xf86Config.c:2327) by 0x49A9BF: InitOutput (xf86Init.c:365) by 0x425A7A: main (main.c:204) Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Reviewed-by: Dan Nicholson <dbn.lists@gmail.com>
2011-11-02hw/xwin: Fix a typo in ddraw.hColin Harrison1-1/+1
Fix a (fortunately benign) typo in ddraw.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard"Yaakov Selkowitz1-46/+2
This commit wreaks havoc with other programs which manage the clipboard, such as MS Office Clipboard or Win32 VNC viewers: http://sourceware.org/bugzilla/show_bug.cgi?id=9910 This reverts commit 70ddd0f39d5118db72a1a4e473cbfb502f1ed9ec. Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02hw/xwin: Stop pretending we work on NT4Jon TURNEY3-57/+11
We already link directly to some functions not available in NT4, so stop pretending we will work on NT4 and link directly to EnumDisplayMonitors() and SHGetFolderPath() Also remove mentions of NT4 & Win95 from error messages Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02hw/xwin: Link directly to TrackMouseEvent()Jon TURNEY6-49/+6
TrackMouseEvent has existed in user32 since at least NT4, so don't bother with jumping through all the ancient compatibility hoops of finding if _TrackMouseEvent() exists in comctl32 so it can check if TrackMouseEvent() exists in user32 to see if it needs to emulate it... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02Cygwin/X: Make default DPI match native DPIJon TURNEY3-5/+25
Make the default DPI match the current Windows DPI setting. If that setting can't be retrieved, change the fallback DPI value from 75 dpi to 96 dpi. Mark the application as dpiAware in the manifest, which prevents dpi virtualization for high (>96) dpi values on Vista and later. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-10-26XWin: windowswm: Correct byte swapping in event notificationsJeremy Huddleston1-1/+3
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-10-19XWinrc.man: fix warning: tab character in unquoted macro argument #35054Gaetan Nadon1-5/+5
Spaces or tabs do not affect the text output layout. Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com> Signed-off-by: Gaetan Nadon <memsize@videotron.ca> Signed-off-by: Keith Packard <keithp@keithp.com>
2011-09-21Use internal temp variable for swap macrosMatt Turner1-3/+3
Also, fix whitespace, mainly around swaps(&rep.sequenceNumber) Reviewed-by: Peter Harris <pharris@opentext.com> Signed-off-by: Matt Turner <mattst88@gmail.com>
2011-07-29Merge remote-tracking branch 'whot/for-keith'Keith Packard2-6/+6
2011-07-27Terminate the log with one last message.Peter Hutterer2-6/+6
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-26Remove hw/xwin/xlaunchJon TURNEY23-3557/+1
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-07-07XWinrc: replace hard coded section number with __filemansuffix__Gaetan Nadon1-1/+1
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-07glx: Remove a few lingering traces of __GLXscreen.GLXVersionJon TURNEY1-6/+2
The GLXversion member of the __GLXscreen struct is just cruft since commit ad5c0d9efa47476ed5cf75c82265c73919e468b4, 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-07hw/xwin: Add -wgl option to XWin manpageJon TURNEY1-0/+4
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-07hw/xwin: Add items to WGL AIGLX todoJon TURNEY1-2/+11
Reviewed-by: Colin Harrison <colin.harrison@virgin.net> Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-07-07hw/xwin: Report Window XIDs in Window debug messagesJon TURNEY2-13/+6
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>