summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2014-01-06Merge branch 'cygwin-patches-for-1.15' into cygwin-release-1.15xserver-cygwin-1.15.0-1Jon TURNEY109-2530/+4493
2014-01-06glx: Flush context which is being made non-current due to drawable going awayJon TURNEY3-0/+10
Some sequences of glean tests fail with GLXBadCurrentWindow when using indirect rendering, e.g. glean -t 'fpexceptions getString'. Flush a context which is being made non-current due to the drawable on which is it is current going away. Waiting until another context is made current is too late, as the drawable no longer exists. v2: Rewrite for direct GL dispatch Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-06Revert "glx: Simplify glXDestroyContext"Jon TURNEY1-1/+3
This reverts commit 7f5adf73a0f9a951a6df201532b4031d38054369. This seems to miss the whole point of the idExists flag, as it makes the lifetime of that being true the same as the lifetime of the Context resource. This leasds to BadContextTag errors when the tag for a deleted context is given as the previous tag in a MakeContextCurrent request.
2014-01-04Improve reliability of clipboard X->Windows pastesJon TURNEY2-48/+31
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 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 is 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.
2014-01-04Fix a potential crash in winRedrawScreenShadowDDNL()Jon TURNEY1-0/+4
Seen during shutdown when using '-depth 8'
2014-01-04Add controls for monitoring PRIMARY selectionJon TURNEY10-3/+70
xwinclip: Add -noprimary option Xwin: Add -primary and -noprimary options and tray-menu control
2014-01-04Retrieve TARGETS to avoid unnecessary failing conversion attemptsJon TURNEY4-86/+194
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. Also: if there is no owned selection, there is nothing to paste, so don't bother trying to convert it.
2014-01-04In SelectionNotify, don't pointlessly retrieve just the size of the propertyJon TURNEY1-18/+2
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...
2014-01-04In SelectionNotify, delete the property containing returned data after we ↵Jon TURNEY1-2/+2
have retrieved it
2014-01-04Improve clipboard debug outputJon TURNEY1-8/+13
2014-01-04hw/xwin: Fix WM_ENDSESSION crash on x86_64Jon TURNEY2-0/+8
We need to include xwin-config.h into winmsgwindow.c, so that _XSERVER64 is defined, so that the layout of ScreenRec type is correct, so that it's privates can be accessed correctly, so that the WM_GIVEUP message can be sent to the screen window. Also add xwin-config.h to other source files which are missing it, to avoid this kind of problem in future... Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-04hw/xwin: Allow gtk_window_maximize() to maximize window in multiwindow modeJon TURNEY1-1/+13
gtk_window_maximize() maximimizes a window by setting _NET_WM_STATE to contain both _NET_WM_STATE_MAXIMIZED_VERT and _NET_WM_STATE_MAXIMIZED_HORZ. Add checking for that state in multiwindow mode hint conversion and maximimize window when it is found. Don't try to implement the separately horizontal and vertical maximimized states for now. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-04hw/xwin: Display host architecture triplet in 'About...' dialogJon TURNEY2-2/+2
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-04More closely follow ICCCM for setting input focusJon TURNEY1-18/+59
In multiwindow mode more closely follow ICCCM section 4.1.7 when setting X input focus to a window when the native Windows window acquires input focus. If InputHint is FALSE, don't use XSetInputFocus() If the Window supports the WM_TAKE_FOCUS protocol, send a WM_TAKE_FOCUS message This helps JDK 1.7 clients acquire the focus correctly. Also, factor out checking client support for a given WM_PROTOCOLS protocol as a separate function. Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-04Undefine _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
2014-01-04Only add to XSetIOErrorHandler() handler chain onceJon TURNEY1-3/+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...
2014-01-04Add a basic manpage for xwinclipJon TURNEY2-0/+64
2014-01-04In clipboard function prototypes, use Window type, not int typeJon TURNEY3-3/+3
2014-01-04Remove XOpenDisplay() retry codeJon TURNEY1-19/+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().
2014-01-04Improve comment about why we can't XCloseDisplay()Jon TURNEY1-2/+5
2014-01-04Remove setjmp()/longjmp() error constantsJon TURNEY2-14/+2
Check specially that setjmp() returned a value which we don't pass to longjmp() seems a bit over-complex.
2014-01-04Move WIN_MSG_QUEUE_FNAME to where it's usedJon TURNEY2-5/+3
2014-01-04Use header for prototypes in textconv.cJon TURNEY1-7/+1
2014-01-04Remove unused X includes from internal.h and add them where neededJon TURNEY4-12/+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
2014-01-04Remove standard includes from internal.h and add them where neeededJon TURNEY2-17/+9
2014-01-04Add xwinclip test clientJon TURNEY3-0/+178
Add xwinclip test client, which includes stubs for winDebug(), ErrorF()
2014-01-04Changes in error logging to make libwinclipboard useful as a libraryJon TURNEY1-31/+25
XXX: see what I've done in wmutil with ErrorF and do the same?
2014-01-04Look up atoms in winClipboardProc()Jon TURNEY4-51/+51
Look up all atoms of interest in clipboard code in winClipboardProc() and pass them down. This avoids the need to check serverGeneration to notice when we need to invalidate cached atom values. Also consistently use cached atom values everywhere, rather than sometimes just doing XInternAtom() again. Remove WIN_LOCAL_PROPERTY as unused now, as we only refer to CYGX_CUT_BUFFER once and do that directly.
2014-01-04Add fUseUnicode as parameter to winClipboardProc()Jon TURNEY3-18/+3
Add fUseUnicode as parameter to winClipboardProc() Access g_fUseUnicode global when calling it
2014-01-04Separate libwinclipboard interface and internal header filesJon TURNEY8-147/+166
Rename the libwinclipboard internal header from winclipboard.h to internal.h Put libwinclipboard's public interface into winclipboard.h This lets winclipboardinit.c partake of that public interface, and all X server headers without clashes winInitClipboard() prototype belongs in a server header v2: Remove duplicate declaration of winClipboardWindowDestroy() Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-04Return a shutdown flag from winClipboardProc() if we should stop tryingJon TURNEY3-8/+15
Return a shutdown flag from winClipboardProc(), and use it in winClipboardThreadProc() to determine if we should stop. Currently this is set if the clipboard messaging window received a WM_QUIT.
2014-01-04Move clipboard integration code down to a subdirectoryJon TURNEY9-12/+25
Move clipboard integration code down to a subdirectory and build as a convenience library
2014-01-04Make g_hwndClipboard staticJon TURNEY4-24/+23
Move winFixClipboardChain() into winclipboardthread.c Add winCLipboardWindowDestroy() function to access it for WM_DESTROY
2014-01-04Add remaining clipboard globals to winglobals.hJon TURNEY2-7/+3
2014-01-04Hoist use of winSetAuthorization() and winGetDisplayName() up one levelJon TURNEY3-24/+23
2014-01-04Eliminate g_pClipboardDisplay and g_iClipboardWindow globalsJon TURNEY4-30/+23
Eliminate the g_pClipboardDisplay and g_iClipboardWindow globals used to make those values available to the clipboard wndproc, by passing them in via the WM_CREATE message instead.
2014-01-04Move winClipboardCreateMessagingWindow() to winclipboardthread.cJon TURNEY3-53/+55
Move winClipboardCreateMessagingWindow() from winclipboardinit.c to winclipboardthread.c, the only place that uses it, and make it static.
2014-01-04Remove SetSelectionOwner wrapper, use XFixesSetSelectionOwnerNotify event ↵Jon TURNEY10-246/+197
instead Use the XFixesSetSelectionNotify event instead of a SetSelectionOwner wrapper, the completely equivalent client-side mechanism.
2014-01-04Remove g_fClipboardLaunched, it's value is identical to g_fClipboardStartedJon TURNEY2-6/+1
2014-01-04Hoist setting of g_fClipboardStarted flag up one levelJon TURNEY2-7/+5
Hoist the setting of g_fClipboardStarted flag up one level. Also move up the clearing of the g_fClipboardLaunched at the end of clipboard function.
2014-01-04winProcEstablishConnection doesn't need to check if clipboard startedJon TURNEY1-8/+0
winProcEstablishConnection doesn't need to check if clipboard has already been started. It should be clear that we start the thread only once when the wrapper tells us to, as the wrapper unhooks itself thereafter.
2014-01-04Hoist clipboard thread restart up one levelJon TURNEY4-39/+43
Hoist clipboard thread restart up one level. Note that currently g_fClipboardLaunched is set the first time in the winProcEstablishConnection wrapper, and subsequent times when the clipboard thread restarts itself. Try to clarify this and just set g_fClipboardLaunched before starting the thread.
2014-01-04Push winClipboardShutdown() into winclipboardinit.cJon TURNEY4-42/+34
Push winClipboardShutdown() into winclipboardinit.c This lets us make g_ptClipboardProc static
2014-01-04Miscellaneous clipboard thread changesJon TURNEY1-4/+6
This is left over after the pthread_exit() calls which used to call winClipboardThreadExit() are removed. - Exit via done label on IOError - Fix a comment - Report pre-flush failure to log Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-01-04Ensure yacc and lex are found by ./configureJon TURNEY1-0/+10
We really need yacc and lex to be available to successfully build tarballs made by cygport directly from a git tag and not by 'make dist'. DO NOT UPSTREAM THIS PATCH.
2014-01-04Improve NET_WM_ICON validationJon TURNEY1-8/+19
Check that we don't overrun the end of the property data while converting icons Also, some warning fixes in winXIconToHICON()
2014-01-04Undefine _XSERVER64 in multiwindow WMJon TURNEY3-62/+66
The XEvent type suffers from the _XSERVER64 issues noted previously: certain members are long int in Xlib, but are made int in the server by XSERVER64. Undefine _XSERVER64 in multiwindow WM, so client code can build correctly on x86_64. This is needed to send the WM_KILL ClientMessage using XSendEvent() correctly. Move winUpdateWindowPosition() to winmultwindowproc.c, as it needs to access the server Drawable structure correctly, which uses affected types. (We still play a dangerous game with bringing the WindowPtr type into scope so we can use it in window shaping code to access the server's shape data. This would be better rewritten as client code using ShapeNotify and XShapeGetRectangles())
2014-01-04Remove obsolete window control IDsJon TURNEY2-59/+0
Remove unused window control IDs and the unused, cygwin-specific handling of those window control IDs for for ChangeLog, UG and CG buttons in the About Dialog.
2014-01-04Work-around problems with using Xlib client macros in the server in a 64-bit ↵Jon TURNEY3-10/+10
build. sizeof(XID) is always 4 in the server, but is 8 in a 64-bit client and coverted to a 32-bit protocol value (it's 4 in a 32-bit client) (See the _XSERVER64 define) This affects the size of members of the _XPrivDisplay type used by some macros in Xlib.h and so means those macros will not give correct answers when we try to use them in server code. Switch to using the equivalent functions, which work correctly, as the code in libX11 is not affected by the types used in the server. A better solution would be to xcb-ize all this code, which also avoids server/client namespace and header clashes.
2014-01-04Handle -displayfd and an explicit display number sensiblyJon TURNEY4-6/+7
Handle -displayfd and an explicit display number sensibly, e.g. use the explicitly specified display number, and write it to the displayfd