summaryrefslogtreecommitdiff
path: root/hw/xwin
AgeCommit message (Collapse)AuthorFilesLines
2015-04-22hw/xwin/winclipboard: Link xwinclip with -lpthreadJon TURNEY1-1/+1
Link xwinclip with -lpthread to fix build for MinGW Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23hw/xwin: Report OS version in logJon TURNEY5-1/+95
Report OS version in log Report if WoW64 is in use Manifest for compatbility with Windows versions, so we don't get lied to by GetVersionEx() Also, make the description in the manifest a bit more generic Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23hw/xwin: Remove Shadow DirectDraw engineJon TURNEY8-1287/+5
Maybe a long time ago this made some kind of sense, but now there's no good reason to ever use this, rather than the Shadow DirectDraw NonLocking engine. Also remove screen private data members used by other removed engines. Also remove no longer needed OS version check in winDetectSupportedEngines() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23hw/xwin: Only set native positions if XINERAMA is enabledJon TURNEY1-8/+12
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23hw/xwin: Register native screens with pseudoramiXJon TURNEY2-0/+61
Update man page to document pseudo-xinerama v2: Make the use of PseudoramiXExtensionInit() match the prototype v3: Update for nonsdk_extinit.h Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16hw/xwin: Turn on -hostintitle by defaultJon TURNEY4-3/+9
Turn on -hostintitle by default Provide -nohostintitle to disable if needed Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16hw/xwin: Report Cygwin version information in logJon TURNEY1-0/+14
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16hw/xwin/glx: Improve code generator to deal with latest Khronos OpenGL ↵Jon TURNEY1-12/+25
registry XML Improve the parsing of the <proto> XML element Include all text from the param element, in the order it appears in the xml document, as part of the formal parameter declaration This is needed to correctly handle the XML description added in svn r27498 of glPathGlyphIndexRangeNV()'s baseAndCount parameter of type GLuint[2] This fixes the way the parameter declaration is generated so it is in the correct form 'GLuint baseAndCount_[2]' and not 'GLuint baseAndCount[2]_' Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16hw/xwin/glx: Refactor parsing of the <proto> XML elementJon TURNEY1-39/+26
Factor out duplicated code used in parsing of the <proto> XML element in the code generator Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-13Drop valuator mask argument from GetKeyboardEventsPeter Hutterer1-1/+1
Nothing was using it and if anyone had they would've gotten a warning and noticed that it doesn't actually work. Drop this, it has been unused for years. Input ABI 22 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
2014-12-08Merge remote-tracking branch 'jturney/master'Keith Packard15-209/+345
2014-11-12Drop trailing whitespacesPeter Hutterer20-52/+52
sed -i "s/[ ]\+$//g" **/*.(c|h) happy reviewing... git diff -w is an empty diff. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-09hw/xwin: Don't allocate one wchar_t too much for unicode text placed on the ↵Colin Harrison1-14/+9
Windows clipboard The count of wchar_t returned by MultiByteToWideChar() includes the terminating null character, so don't add one to it. Also, reduce the scope of various length variables Signed-off-by: Colin Harrison <colin.harrison@virgin.net> Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-11-09hw/xwin: Fix hang on shutdown when we own the clipboard.Jon TURNEY1-41/+25
If we are the clipboard owner when we are shutdown, we recieve a WM_RENDERALLFORMATS, to render the clipboard, so it's contents will remain available to other applications. Unfortunately, this is far too late to do anything useful with, as the server is waiting for the clipboard thread to exit, and so can't process requests to convert clipboard contents. Change so we just do nothing on WM_RENDERALLFORMATS. (I'm not convinced that WM_RENDERALLFORMATS has ever worked usefully, in any case). (To make this work, I guess we would need to rearrange the way shutdown works completely: first synchronously stop the clipboard, then stop the X server) We also then receive a WM_DRAWCLIPBOARD, perhaps telling us that the available clipboard formats have changed (as ones which haven't been rendered are now removed), but the clipboard owner is now the system, not us, which we have to arrange to ignore. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-09hw/xwin: Fix clipboard thread restartJon TURNEY3-2/+9
It seems that the clipboard thread restart mechanism has been broken for a while, which can be demonstrated using XDMCP with KDM (e.g. to a Kubutunu 12.04 host) KDM kills all attached clients, including the clipboard integration client, which restarts, but then exits on WM_QUIT. Using PostQuitMessage() in WM_DESTROY is unhelpful, as we may not actually be quitting the thread, if we just destroyed the window because the clipboard thread is about to retry, because he WM_QUIT message sticks around, and is noticed the next time we look at the window message queue and confuses us into thinking we need to quit. Sending a WM_DESTROY is apparently never correct anyhow, see [1] So: 1/ Use DestroyWindow() to destroy the clipboard messaging window when cleaning up for retry or exit in winClipboardProc (the clipboard thread main proc) 2/ Send a special WM_WM_QUIT message in winClipboardWindowDestroy() from the X server thread when the X server is resetting. 3/ When processing that WM_WM_QUIT message in the clipboard thread, cause the clipboard window to PostQuitMessage(), which causes the clipboard thread to exit. [1] http://blogs.msdn.com/b/oldnewthing/archive/2011/09/26/10216420.aspx Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-09hw/xwin: Improve reliability of clipboard X->Windows pastesJon TURNEY2-43/+41
Sometimes, particularly with large clipboard pastes to Windows, we could end up waiting for the timeout to expire, rather than pasting the data. Various changes to improve reliability: 1. Use XFlush() not XSync() in winProcessXEventsTimeout(). It makes no sense to ensure we have received replies to outstanding requests if we are going to wait for them using select() 2. Add XFlush() to winClipboardProc() Make sure we have sent any requests before we wait using select() 3. Don't use FD_ISSET() to check which fd is ready This looks like a Cygwin select() bug in that it sometimes returns 0 with an empty fd set before the timeout expires, but a fd appears to be ready. Add select() return value to debug output when we are warning that this has happened. 4. Drain event queues before entering select() Unconditionally drain event queues before entering select(). This seems to be the recommended way of writing select() and X event processing loops. winClipboardFlushXEvents() checks using XPending(), and winClipboardFlushWindowsMessageQueue() checks using PeekMessage() so this is safe against blocking, but means that may not need to enter select() at all sometimes. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-09hw/xwin: Add controls for enabling/disabling monitoring of PRIMARY selectionJon TURNEY11-3/+77
xwinclip: Add -noprimary option Xwin: Add -primary and -noprimary options and tray-menu control v2: Use Bool type for fPrimarySelection Add -noprimary to usage message Fix indentation in hw/xwin/winwndproc.c Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-06hw/xwin: Retrieve TARGETS to avoid unnecessary failing conversion attemptsJon TURNEY4-86/+195
See http://cygwin.com/ml/cygwin-xfree/2013-07/msg00016.html It looks like the change in a9aca218f557c723e637287272819a7c17174e1e had some unforseen consequences. If the X11 selection contents are not convertable to COMPOUND_TEXT, UTF8_STRING or STRING format (for example, if it is an image), after those conversion attempts have failed, we sit in winProcessXEventsTimeout() until the timeout expires. It also seems that maybe gnuplot doesn't respond correctly to this sequence of conversion requests and doesn't reply to some of them, which also causes us to sit in winProcessXEventsTimeout() until the timeout expires. The Windows application which has requested the clipboard contents via GetClipboardContents() is blocked until we return from WM_RENDERFORMAT, so sitting waiting for this timeout to expire should be avoided. So instead, explicitly request conversion to the TARGETS target, choose the most preferred format, and request conversion to that. Also: if there is no owned selection, there is nothing to paste, so don't bother trying to convert it. v2: Fix compilation with -Werror=declaration-after-statement Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-06hw/xwin: In SelectionNotify, don't pointlessly retrieve just the size of the ↵Jon TURNEY1-18/+2
property Don't pointlessly retrieve just the size of the property, if we are then going to assume we can retrieve the whole property in one request anyhow... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-06hw/xwin: In SelectionNotify, delete the property containing returned data ↵Jon TURNEY1-2/+2
after we have retrieved it Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-06hw/xwin: Remove some redundant clipboard externs, now defined in winglobals.hJon TURNEY2-15/+0
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-27Merge remote-tracking branch 'jturney/master'Keith Packard14-29/+29
Conflicts: hw/xwin/winpixmap.c Adam removed a pile of windows code, including this file.
2014-10-09hw/xwin: Fix unused variable warning in winCreateMsgWindow()Jon TURNEY1-2/+1
winmsgwindow.c:99:11: warning: variable ‘winClass’ set but not used [-Wunused-but-set-variable] Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix redundant declaration warning in winprefslex.lJon TURNEY1-2/+0
winprefslex.l:40:12: warning: redundant redeclaration of ‘yyparse’ [-Wredundant-decls] winprefsyacc.h:130:5: note: previous declaration of ‘yyparse’ was here Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix warning in yyerror()Jon TURNEY1-2/+1
winprefsyacc.y:257:3: warning: nested extern declaration of ‘yylineno’ [-Wnested-externs] Promote yylineno declaration to file scope Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix const warning in winPrefsLoadPreferences()Jon TURNEY1-1/+1
winprefs.c:643:14: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix const warnings in winprefsyacc.yJon TURNEY1-4/+4
winprefsyacc.y:174:5: warning: passing argument 1 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:174:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:175:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.y:178:5: warning: passing argument 3 of ‘AddMenuLine’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:67:13: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.c:1737:9: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] winprefsyacc.y:82:12: note: expected ‘char *’ but argument is of type ‘const char *’ winprefsyacc.c:1854:3: warning: passing argument 1 of ‘yyerror’ discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix const warning in winCheckDisplayNumber()Jon TURNEY1-1/+1
InitOutput.c:1032:19: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default] Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix warning in winXIconToHICON()Jon TURNEY1-1/+1
winmultiwindowicons.c:403:29: warning: passing argument 8 of ‘XGetWindowProperty’ from incompatible pointer type [enabled by default] /usr/include/X11/Xlib.h:2688:12: note: expected ‘Atom *’ but argument is of type ‘long unsigned int *’ Looks like this has been wrong since I added it in 527cf131 :-( Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix format warnings with debug printing of pointers on 64-bitJon TURNEY8-17/+17
Fix various pieces of debug output, mainly under --enable-debug, which use a "%08x" printf format for a pointer type. Use "%p" format for 64-bit portability. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix warnings in glx/glshim.cJon TURNEY1-0/+3
glext.h currently requires GL_GLEXT_PROTOTYPES in order to prototype glCompressedTexImmage* functions generated_gl_shim.c:2859:6: warning: no previous prototype for 'glCompressedTexImage3DARB' [-Wmissing-prototypes] generated_gl_shim.c:2866:6: warning: no previous prototype for 'glCompressedTexImage2DARB' [-Wmissing-prototypes] generated_gl_shim.c:2873:6: warning: no previous prototype for 'glCompressedTexImage1DARB' [-Wmissing-prototypes] generated_gl_shim.c:2880:6: warning: no previous prototype for 'glCompressedTexSubImage3DARB' [-Wmissing-prototypes] generated_gl_shim.c:2887:6: warning: no previous prototype for 'glCompressedTexSubImage2DARB' [-Wmissing-prototypes] generated_gl_shim.c:2894:6: warning: no previous prototype for 'glCompressedTexSubImage1DARB' [-Wmissing-prototypes] generated_gl_shim.c:2901:6: warning: no previous prototype for 'glGetCompressedTexImageARB' [-Wmissing-prototypes] Also, explicitly prototype glXGetProcAddressARB(), as glx/glxdri*.c does, as it's not practical to include glx.h here... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix compilation with -Werror=declaration-after-statementJon TURNEY1-1/+2
xevents.c: In function 'winClipboardInitMonitoredSelections': xevents.c:129:5: error: 'for' loop initial declarations are only allowed in C99 mode for (int i = 0; i < CLIP_NUM_SELECTIONS; ++i) Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09hw/xwin: Fix compilation with -Werror=return-typeJon TURNEY1-1/+1
winshadddnl.c: In function ‘winRedrawScreenShadowDDNL’: winshadddnl.c:991:9: error: ‘return’ with no value, in function returning non-void [-Werror=return-type] Just wrong in 1c34e774 Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09xwin: Remove primary DirectDraw engineAdam Jackson7-667/+2
Again, as the documentation says, "unsupported, obsolete". Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09xwin: Remove native GDI engine (v2)Adam Jackson19-3096/+2
As the man page says, "unsupported, experimental, and barely functional". The last even minor updates to any of this were back in 2004, presumably it's not getting better any time soon. This is also the only GC ops implementation in the tree that actually falls all the way down to the spans routines for everything, so that's pretty nice to be rid of. v2: Fix stray break statement (Jon) Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-02Merge remote-tracking branch 'ajax/dead-code'Keith Packard1-1/+0
2014-09-26xfree86: Remove Option "TextClockFreq"Adam Jackson1-1/+0
No modern driver pays attention to this. Presumably there existed hardware once where you couldn't just read the right values out of the CRTC. Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-09-13hw/xwin: Undefine _XSERVER64 in hw/xwin/winclipboardJon TURNEY6-2/+47
Including any server header might define the macro _XSERVER64 on 64 bit machines. That macro must _NOT_ be defined for Xlib client code, otherwise bad things happen. So let's undef that macro if necessary. Remove server directories from include path to ensure no server includes are included Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Only add to XSetIOErrorHandler() handler chain onceJon TURNEY1-4/+9
Only use XSetIOErrorHandler() to add to the global XSetIOErrorHandler() chain once. If we do it every restart, then we make a loop in the handler chain, and we end up with a thread spinning in that loop when the server shuts down... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Add a basic manpage for xwinclipJon TURNEY2-0/+64
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: In clipboard function prototypes, use Window type, not int typeJon TURNEY3-3/+3
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Remove XOpenDisplay() retry codeJon TURNEY1-20/+1
Remove XOpenDisplay() retry code. This isn't a sensible thing for the application to be doing, and XWin server needs to retry much more than just XOpenDisplay(). Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Improve comment about why we can't XCloseDisplay()Jon TURNEY1-2/+5
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Remove setjmp()/longjmp() error constantsJon TURNEY2-13/+2
Check specially that setjmp() returned a value which we don't pass to longjmp() seems a bit over-complex. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Move WIN_MSG_QUEUE_FNAME to where it's usedJon TURNEY2-5/+3
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Use header for prototypes in textconv.cJon TURNEY1-7/+1
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Remove unused X includes from internal.h and add them where neededJon TURNEY4-11/+11
Also removing server headers we might clash with and no longer need. Make a few adjustments to allow for this change: - provide a prototype of ErrorF() - use the MAX() macro provided by sys/param.h, not the max() macro provided by misc.h - use the X 'Bool' type rather than the unwrapped Windows 'BOOL' type Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Remove standard includes from internal.h and add them where neededJon TURNEY2-18/+9
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Add xwinclip test clientJon TURNEY3-0/+178
Add xwinclip test client, which includes stubs for winDebug(), ErrorF() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13hw/xwin: Changes in error logging to make libwinclipboard more useful as a ↵Jon TURNEY1-26/+25
library Consistently use ErrorF() rather than winErrorFVerb() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk> Reviewed-by: Colin Harrison <colin.harrison@virgin.net>