This doesn't seem very useful, and we're about to implement 1.4 across
the board, so some WGL extensions will become required.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
On xquartz this enables SGI_make_current_read, which is a mostly
harmless lie as CGL doesn't implement it, as well as SGIX_pbuffer, which
is fine because no pbuffer-enabled configs are created.
On xwin this enables SGIX_pbuffer and ARB_multisample in all cases.
Again this is harmless if the backend doesn't support the features,
since no fbconfigs will be created to expose them.
It also adds SGIX_visual_select_group to both xquartz and xwin.
Amusingly, both were filling in the appropriate field in the fbconfig
already.
v2: Warn about missing WGL extensions (Emil)
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This seems to be fairly universal these days, and if it doesn't exist
the only thing you break is separate drawable and readable, which is a
rare feature to use. So pretend it's always there and just throw an
error on MakeCurrent if it isn't, and don't consider it when computing
the GLX version number.
v2: Fix type-o for glxWinScreen (Jon Turney)
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This extension is direct-only and has no GLX protocol. We don't even
track an enable bit for it, trying to turn it on is pointless.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
This existed only to be strdup'd and then immediately freed.
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
- winVMsg() has no uses, so remove
- winMsgVerb() has only one use, with default verbosity, so remove
- winMsg() is identical to LogMessage()
- Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG
- Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Unused since native GDI engine removal in commit 8465ee78
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This only ever had an (unused) implementation in the DDNL engine, which was
removed in commit 57bbf6e2.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This was only ever used by the primaryfb engine, removed in commit c79f824b
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Return FALSE to indicate failure in winSetEngine(), if it couldn't find a
drawing engine to use
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Remove fAnotherWMRunning which tracks this message (although since it was
never initialized, I doubt this worked reliably), and the only use of that,
which was to prevent winMWExtWMRestackWindows() from being used when the
internalwm is running
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Also remove then unused variables and IsRaiseonClick()
v2:
Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame()
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Remove the fInternalWM flag as it is now always FALSE after removing the
-internalwm option
v2:
Also remove then unused pRLWinPriv local from pRLWinPriv()
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Rather than only looking at the foreground window to see if it matches
the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from
the window privates.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Factor out the MessageName() debug helper for message id -> text, and
use it on message queue and dequeue.
Reorder in numerical order to match winwindow.h
Add missing WM_WM_ICON_EVENT
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
layout zh_TW doesn't exist (anymore), try something else for that.
layout it variant mac doesn't seem to exist anymore, try to handle
Macintosh keyboards (running under Parallels on Mac) and other oddities
in a more generic way, by falling back to matching only on the language
identifer part of the input locale identifer.
v2:
Fix typo of 0xa0000 for 0xa000
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
If using the X server internal XRANDR 1.0 interface, it seems we must
register a display size with RRRegisterSize() in order to make
RRGetInfo() call RRScanOldConfig() to generate an output and crtc for
us.
Without this, the following GDM bug means that an XDMCP session to GDM
cannot be started.
https://bugzilla.gnome.org/show_bug.cgi?id=736054
Instead, use the more recent XRANDR 1.2 internal interface to explicitly
create the output and crtc, and maintain a single mode which represents
the current display size.
Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done
which has no effect, this seems to throw the GDM greeter into a loop...
v2: Maintain reference count for the mode we maintain more correctly, to
avoid double free causing a crash on shutdown
Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't
change anything, so we don't fail due to our lack of rrSetConfig or
rrCrtcSet hooks.
See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html
v3:
Raise limit on X display size from 4Kx4K to 32Kx32K
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Windows Vista and later have a saner clipboard API where the clipboard
viewer linked list is no longer maintained by applications. Use it
where available.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Improve the check that window position is visible to work correctly for
non-rectangular virtual desktops
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
When motif decoration hint asks for no decoration, don't add sysmenu,
mimimize or maximimize controls.
(This fixes a problem with e.g. fbpanel having a minimize control, but
gtk's panel_configure_event() doesn't like the state we put the window
into when we minimize it, causing it to spin)
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
XGetWMNormalHints() doesn't actually return a Status value. On success
it returns a non-zero value, not Success.
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Fix format warnings (mainly pointer format fixes) which show up when
./configured --enable-debug --enable-windowswm
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.
Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.
Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.
This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Removes the last cpp conditional on ROOTLESS from dix code.
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Pixel is CARD32, so inside the server has type unsigned int (x86_64) or unsigned
long (x86)
Cast to unsigned int and use a %u format
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Some Win32 API types are different fundamental types in the 32-bit and 64-bit
This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.
This makes it impossible to write printf format specifiers which are correct for
all those targets, so we use some macros to provide the correct specifier for
the target.
LPARAM and WPARAM are integer types which can contain a pointer
LPARAM is long in ILP32 and long long in LLP64
WPARAM is unsigned int in ILP32 and unsigned long long in LLP64
Generally, these are just used to passs integer parameters, so for simplicity,
cast to int and use an int-compatible format
In the specific case of WM_CHANGECBCHAIN, they are used to pass HWND, so cast to
that type and print using an appropriate format.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Some Win32 API types are different fundamental types in the 32-bit and 64-bit
versions.
This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.
This makes it impossible to write printf format specifiers which are correct for
all those targets
In the Win32 API, DWORD is an signed, 32-bit type. It is defined in terms of a
long, except in the LP64 data model, where it is an int.
It should always be safe to cast it to int and use %d.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Some Win32 API types are different fundamental types in the 32-bit and 64-bit
versions.
This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.
This makes it impossible to write printf format specifiers which are correct for
all those targets
In the Win32 API, DWORD is an unsigned, 32-bit type. It is defined in terms of
an unsigned long, except in the LP64 data model, where it is an unsigned int.
It should always be safe to cast it to unsigned int and use %u or %x.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Window and Atom types derive from XID, which is always unsigned long in client
code, so use %ld format specifier
XTextProperty.nitems is of type unsigned long, so use %lu format specifier
ulReturnBytesLeft is of type unsigned long, so use %lu format specifier
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
remainingTime is computed as a long int, so use %ld format specifier
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
serverGeneration is of type unsigned long, so use %lu format specifier
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
struct winInfoRec.keyboard members are of type long, not type int
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
XID inside the server has type unsigned int (x86_64) or unsigned long (x86)
Follow the example of the rest of the server and cast to unsigned int and use
a %u or %x format.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
HWND derives from HANDLE, a pointer type, so we should use the %p format
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
The use of %d format for the DWORD return value of GetTickCount() isn't
portable, but it doesn't seem to be worth fixing it when this information isn't
very useful (and is redundant to the timestamping of log messages we now have)
Instead just remove these uses of GetTickCount()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
See http://cygwin.com/ml/cygwin-xfree/2013-07/msg00016.html
It looks like the change in a9aca218f5 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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Again, as the documentation says, "unsupported, obsolete".
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
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>
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>
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>
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>
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>
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>
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>
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>
Consistently use ErrorF() rather than winErrorFVerb()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Add fUseUnicode as parameter to winClipboardProc()
Access g_fUseUnicode global when calling it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Move clipboard integration code down to a subdirectory and build as a
convenience library
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Move winFixClipboardChain() into winclipboardthread.c
Add winCLipboardWindowDestroy() function to access it for WM_DESTROY
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Move winClipboardCreateMessagingWindow() from winclipboardinit.c to
winclipboardthread.c, the only place that uses it, and make it static.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Use the XFixesSetSelectionNotify event instead of a SetSelectionOwner wrapper,
the completely equivalent client-side mechanism.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Push winClipboardShutdown() into winclipboardinit.c
This lets us make g_ptClipboardProc static
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Commit c1bf3baa44 removed all but one of the
pthread_exit() calls which used to call winClipboardThreadExit()
Fix the final remaining one to exit via done label on IOError instead.
Also fix a comment and report pre-flush failure to log, but do not exit
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
The piglit test glx_make_current triggers this assertion, by making the context
current on a different drawable before issuing a glXSwapBuffers()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
It happens whenever a GLX client uses GL on a window before it's been mapped, so
don't log it like an error.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
fbConfigToPixelFormatIndex()'s drawableTypeOverride parameter is a drawable
type bitmask, not a drawable type enum value
WGL_SWAP_COPY_ARB is a value of the WGL_SWAP_METHOD_ARB attribute for
wglChoosePixelFormatARB(), not an attribute itself
also remove duplicate error reporting for wglChoosePixelFormat() and fix a
comment
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Update to align with rewrite of wrapper generation script in commit
583a1146233f16d861706926706e5feec3baffba
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Don't override the server supported GL extensions string.
The string reported to the client is the intersection of client, server and GL
implementation extensions.
Overriding the server supported GL extensions string like this causes extensions
which are supported by the client and implementation, but not by the server, to
be erroneously reported, so don't change it.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Add an idempotency guard to glwindows.h
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Seen during shutdown when using '-fullscreen' and '-depth 8'
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Choose the display name used to connect to internal clients and exported into
environment of processes started from the traymenu so that it uses a transport
we know is working
This should mean the server can start correctly with -multiwindow and/or
-clipboard and any two of -nolisten inet6, -nolisten inet and -nolisten unix
(the server will correctly refuse to start if all 3 are used, as it must be
listening on at least one socket)
v2:
Place prototype for winGetDisplayName() in windisplay.h, and include it where
needed.
v3:
Include xwin-config.h, so that _XSERVER64 is defined, just in case anything
relies on that.
v4:
Replace grovelling around in the server's list of listeners with new Xtrans
TransIsListening() interface, added in Xtrans 1.3.3
See also [1]
[1] https://sourceware.org/bugzilla/show_bug.cgi?id=10725
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
- Rename XWIN_GLX_LINK_FLAGS -> XWIN_GLX_SYS_LIBS for consistency
- Rename MULTIWINDOW_LIBS -> MULTIWINDOW_SYS_LIBS for consistency
- Don't link with XWin with $(MAIN_LIB), it provides it's own main()
- Put one library per line for more intelligible diffs when one is added
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
This fixes a problem when using Khronos registry data since the change of
2013-08-16 removed glBlend(Color|Equation) from GL1.2 and added them to
GL_ARB_imaging.
If shim generation considers all features, no shims are generated for
glBlend(Color|Equation) as they are first emitted for GL 1.4 (which we ignore as
shims are only generated for GL version <=1.2), then emission for GL_ARB_imaging
is skipped as they have already been emitted.
Also improve feature name matching so it is exact, not on an initial substring,
so 'GL_ARB_texture_compression_bptc' and 'GL_ARB_texture_compression_rgtc'
aren't matched by 'GL_ARB_texture_compression'.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
With my patch to fix shared libXfont to work correctly on Cygwin/Win32,
there is no need for -static anymore. But, XWin.exe must export its
symbols in order for them to override libXfont's stubs.
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Update for __glXLastContext -> lastGLContext.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Build fbcmap_mi.c once, rather than once for each DDX, and make it part of libfb
or libwfb convenience library.
Since 84e8de1271 we don't have fbcmap.c
This is a sort of revert of 17d85387d1
v2: Remove libkdrivestubs.la from configure.ac
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
Looping around LoadExtension() meant that ExtensionModuleList was reallocated
on every extension. Using LoadExtensionList() we pass an array thus the
function can do the reallocation in one go, and then loop and setup the
ExtensionModuleList.
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
v2: Update ephyr [Keith Packard]
v3: Eliminate const warnings in LoadExtensionList [Keith Packard]
Signed-off-by: Keith Packard <keithp@keithp.com>
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.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Check that we don't overrun the end of the property data while converting icons
See http://cygwin.com/ml/cygwin-xfree/2013-06/msg00040.html for testcase.
Also, some warning fixes in winXIconToHICON()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Remove the unused, cygwin-specific handling for ChangeLog, UG and CG buttons in
the About... Dialog. The buttons themselves were removed in commmit
34269a90ea.
Also remove those window control IDs which are now obsolete.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
In multiwindow mode the modal moving/resizing of windows causes a lot of redraw
events to be sent to the X clients after the user releases the mouse button.
During the moving/resizing client windows are not redrawn as long as the mouse
button is pressed, but all redraw/resizing events are queued and executed step
after step after the moving/resizing ends.
Some clients collect and combine multiple redraw or resizing events, other
clients (e.g. xterm) simply execute each redraw or sizing event.
The enclosed patch minimizes the events for clients to only one event after the
user releases the mouse button to end the moving/resizing. This improves the
user experience and reduces strange screen flickerings, especially on slow
platforms.
The enclosed patch modifies winmultiwindowwndproc.c such that the windows events
WM_ENTERSIZEMOVE and WM_EXITSIZEMOVE that are sent by Windows when the modal
window resizing/moving begins or ends are considered. Only after WM_EXITSIZEMOVE
is the redraw/resizing executed.
Signed-off-by: Oliver Schmidt <oschmidt-mailinglists@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Enhance GetWindowName() so it appends the result of XGetWMClientMachine() when
it is available and useful to do so
Add -hostintitle option to control this behaviour. Add documentation for this
option to man page and -help text.
Also, fix warning in UpdateName()
v2: Provide a HOST_NAME_MAX definition for MinGW
v3: Use '@host' rather than ' (on host)'. Don't add host if it's already in the
title.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
winMWExtWMUpdateIcon() was removed in commit 527cf13135
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Use AllocDevicePair() rather than allocating Windows keyboard and pointer
devices individually.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
For clarity, use boolean AND rather than bitwise AND in
WIN_POLLING_MOUSE_TIMER_ID processing.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Fix const discarded warning in winGenerateAuthorization() in !XCSECURITY case
In function ‘winGenerateAuthorization’:
hw/xwin/winauth.c:123:38: warning: passing argument 2 of ‘GenerateAuthorization’ discards ‘const’ qualifier from pointer target type [enabled by default]
hw/xwin/winauth.c:99:1: note: expected ‘char *’ but argument is of type ‘const char *’
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
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>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Remove unnecessary casts from malloc/realloc/calloc calls. This is the style
used for the majority of X server code.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Somehow this was left out of commmit f3fad371cc
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Allow the bell to be turned off with X server option '-f 0', or by 'xset b off'.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
A follow up to commits 2d9123fd, 451c5d91 and efe96a17, which changed the
parameter name in the definition from index to i, to fix shadowing index() but
didn't adjust the prototype declaration.
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Just generate the WGL wrappers we need, rather than for everything in wgl.xml
This avoids generating a lot of unused wrappers, and also avoids compilation
requiring a wglext.h at least as new as wgl.xml
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>