Commit Graph

894 Commits

Author SHA1 Message Date
Jon TURNEY e1cf2b47be hw/xwin: Look up atoms in winClipboardProc()
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>
2014-09-13 14:18:33 +01:00
Jon TURNEY be61a1fc7e hw/xwin: Add fUseUnicode as parameter to winClipboardProc()
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>
2014-09-13 14:18:30 +01:00
Jon TURNEY 126c1cfaa5 hw/xwin: Separate libwinclipboard interface and internal header files
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>
2014-09-13 14:13:07 +01:00
Jon TURNEY 30c535219e hw/xwin: Return a shutdown flag from winClipboardProc() if we should stop trying
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>
2014-09-13 14:06:30 +01:00
Jon TURNEY 88d4459704 hw/xwin: Move clipboard integration code down to a subdirectory
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>
2014-09-13 14:06:28 +01:00
Jon TURNEY e965001a73 hw/xwin: Make g_hwndClipboard static
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>
2014-09-13 14:06:25 +01:00
Jon TURNEY 03a59e7f78 hw/xwin: Add remaining clipboard globals to winglobals.h
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13 14:06:23 +01:00
Jon TURNEY 8f9fba5bc1 hw/xwin: Hoist use of winSetAuthorization() and winGetDisplayName() up one level
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13 14:06:20 +01:00
Jon TURNEY a3c1e405cb hw/xwin: Eliminate g_pClipboardDisplay and g_iClipboardWindow globals
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>
2014-09-13 14:06:18 +01:00
Jon TURNEY 229a0a83a4 hw/xwin: Move winClipboardCreateMessagingWindow() to winclipboardthread.c
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>
2014-09-13 14:06:16 +01:00
Jon TURNEY a70c2384a2 hw/xwin: Remove SetSelectionOwner wrapper, use XFixesSetSelectionOwnerNotify event instead
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>
2014-09-13 14:06:13 +01:00
Jon TURNEY ab55746c1b hw/xwin: Remove g_fClipboardLaunched, it's value is identical to g_fClipboardStarted
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-09-13 14:06:11 +01:00
Jon TURNEY 42d1381082 hw/xwin: Hoist setting of g_fClipboardStarted flag up one level
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>
2014-09-13 14:06:08 +01:00
Jon TURNEY 290dbff075 hw/xwin: winProcEstablishConnection doesn't need to check if clipboard started
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>
2014-09-13 14:06:05 +01:00
Jon TURNEY 91e55691ef hw/xwin: Hoist clipboard thread restart up one level
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>
2014-09-13 14:06:02 +01:00
Jon TURNEY 0bb6eae4e3 hw/xwin: Push winClipboardShutdown() into winclipboardinit.c
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>
2014-09-13 14:05:59 +01:00
Jon TURNEY 6343b531d7 hw/xwin: Remove left-over pthread_exit() in clipboard code
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>
2014-09-13 14:05:44 +01:00
Jon TURNEY f92df22a03 hw/xwin/glx: Remove an incorrect assertion in glxWinDrawableSwapBuffers
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>
2014-08-29 13:56:36 +01:00
Jon TURNEY b21321e515 hw/xwin/glx: Downgrade "forcing window to exist" message to debug
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>
2014-08-29 13:55:21 +01:00
Jon TURNEY 31d0896336 hw/xwin/glx: Fix a couple of typo bugs in indirect.c
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>
2014-08-29 13:52:08 +01:00
Jon TURNEY b1ea714cdc hw/xwin/glx: Update .gitignore
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>
2014-08-29 13:49:08 +01:00
Jon TURNEY d1d3bd3596 hw/xwin/glx: Don't override the server supported GL extensions string.
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>
2014-08-29 13:41:26 +01:00
Jon TURNEY c99cd058a8 hw/xwin: Add an idempotency guard to glwindows.h
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>
2014-08-29 13:40:26 +01:00
Jon TURNEY 1c34e774ef hw/xwin: Fix a potential crash in winRedrawScreenShadowDDNL()
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>
2014-08-29 13:32:50 +01:00
Jon TURNEY 16d9da0886 hw/xwin: Improve choice of display name used by internal clients
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>
2014-08-29 13:28:00 +01:00
Jon TURNEY 95357539c1 hw/xwin: Makefile.am cleanup
- 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>
2014-08-29 13:25:16 +01:00
Jon TURNEY aa40d0c071 hw/xwin/glx: When generating shims, limit the considered features to GL version <=1.2
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>
2014-08-29 13:22:36 +01:00
Yaakov Selkowitz a5499870e2 hw/xwin: link dynamically and export symbols
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>
2014-07-03 15:48:07 +01:00
Jon TURNEY aaaa413456 hw/xwin: Update for __glXLastContext -> lastGLContext
Update for __glXLastContext -> lastGLContext.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-06-02 13:07:17 +01:00
Jon TURNEY 432fc37e2c Build fbcmap_mi.c once, rather than once for each DDX
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>
2014-03-27 14:34:06 +00:00
Jon TURNEY f23dd02b96 Build Xi/stubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2014-03-27 14:09:43 +00:00
Jon TURNEY 45b223e1c2 Build dpmsstubs.c once as a convenience library, rather than once for each DDX which wants to use it
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Gaetan Nadon <memsize@videotron.ca>
2014-03-27 14:09:33 +00:00
Emil Velikov e46820fb89 miinitext: introduce LoadExtensionList() to replace over LoadExtension()
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>
2014-03-25 16:00:17 -07:00
Jon TURNEY 0e5d2996ac hw/xwin: Fix WM_ENDSESSION crash on x86_64
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>
2014-03-22 18:56:46 +00:00
Jon TURNEY 896b53ffa7 hw/xwin: Improve NET_WM_ICON validation
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>
2014-03-22 18:56:43 +00:00
Jon TURNEY ab61d07002 hw/xwin: Remove obsolete control handling for About dialog
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>
2014-03-22 18:56:41 +00:00
Oliver Schmidt 3b4d472b72 hw/xwin: Minimize redraw events after resizing/moving windows in multiwindow mode
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>
2014-03-22 18:56:38 +00:00
Jon TURNEY 03e1cc6f25 hw/xwin: Add '@<WM_CLIENT_MACHINE>' to window name when it's useful to do so
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>
2014-03-22 18:55:47 +00:00
Colin Harrison 6804acfe4f hw/xwin: Remove prototype for non-existent winMWExtWMUpdateIcon()
winMWExtWMUpdateIcon() was removed in commit 527cf13135

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:56 +00:00
Colin Harrison 7fb5d765ba hw/xwin: Use AllocDevicePair()
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>
2014-03-22 17:16:54 +00:00
Colin Harrison 061e5eba00 hw/xwin: Consistently use 'L' for long int constants
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:51 +00:00
Colin Harrison 46df614784 hw/xwin: Remove an unneeded include
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:48 +00:00
Colin Harrison d48749492d hw/xwin: Use boolean AND rather than bitwise AND in WIN_POLLING_MOUSE_TIMER_ID
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>
2014-03-22 17:16:46 +00:00
Colin Harrison 80ac4a85d5 hw/xwin: Fix declaration after statement warning in ddxGiveUp()
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:43 +00:00
Colin Harrison cf59f4888e hw/xwin: Fix typo in comment
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-22 17:16:41 +00:00
Jon TURNEY 561bca469d hw/xwin: Fix const discarded warning in winGenerateAuthorization()
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>
2014-03-22 17:16:38 +00:00
Jon TURNEY b634e90989 hw/xwin: More closely follow ICCCM for setting input focus
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>
2014-03-03 14:33:09 +00:00
Colin Harrison 0fc84a2bb6 hw/xwin: Remove unnecessary casts from malloc/realloc/calloc calls
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>
2014-03-03 14:32:57 +00:00
Colin Harrison 94f709cfce hw/xwin: Add missing FORCEEXIT token to XWin configuration file lexer
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>
2014-03-03 14:32:47 +00:00
Colin Harrison 6432d44020 hw/xwin: Silence bell when volume is zero
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>
2014-03-03 14:32:30 +00:00
Colin Harrison 7e37c4f727 hw/xwin: Fix typo in comment
'i' before 'e' except after 'c'

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2014-03-03 14:32:06 +00:00
Colin Harrison d75195b626 hw/xwin: Align parameter names in prototypes with definition
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>
2014-03-03 14:31:17 +00:00
Jon TURNEY e53568e2c5 hw/xwin: Just generate the WGL wrappers we need
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>
2014-03-03 14:30:53 +00:00
Yaakov Selkowitz dec5e9899b hw/xwin: Fix implicit-function-declaration warning in XwinExtensionInit() when compiled with XWIN_GLX_WINDOWS defined
InitOutput.c: In function ‘XwinExtensionInit’:
InitOutput.c:170:9: error: implicit declaration of function ‘glxWinPushNativeProvider’ [-Werror=implicit-function-declaration]
         glxWinPushNativeProvider();
         ^
InitOutput.c:170:9: warning: nested extern declaration of ‘glxWinPushNativeProvider’ [-Wnested-externs]

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>
2014-03-03 14:30:27 +00:00
Keith Packard 60014a4a98 Replace 'pointer' type with 'void *'
This lets us stop using the 'pointer' typedef in Xdefs.h as 'pointer'
is used throughout the X server for other things, and having duplicate
names generates compiler warnings.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2014-01-12 10:24:11 -08:00
Jon TURNEY 9a4d7572fe hw/xwin/glx: Rewrite WGL wrappers after Xserver conversion to direct GL dispatch
v1: Rewrite by Marc Haesen of the WGL wrapper function generation script to use
Khronos group XML.

v2: Remove -dispatchheader option, since dispatch.h doesn't exist anymore, use
the private glapi interface to construct the GL dispatch table for the native
WGL thunks.

v3:
Rewrite to generate shims for the OpenGL 1.2.1 (GL 1.2 + GL_ARB_imaging
+GL_ARB_multitexture + GL_ARB_texture_compression(?)) functions the server links
directly with rather than libGL.

These shims dispatch to either the mesa GL DLL, or a thunking DLL containing
cdecl-to-stcall wrapper functions for the native GL DLL.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-12-10 17:00:06 +00:00
Daniel Czarnowski ccc8bb1153 glx: Handle float config types in glxConvertConfigs
Replaces old use of floatMode attribute with new, extended range of
values in __DRI_ATTRIB_RENDER_TYPE. Also adds new conditions, where the
float modes support requires it. Enables support for not only float
configs, but packed float configs as well.

v2 (idr): Whitespace and formatting fixes.  Refactor render type
vs. pbuffer checking to a separate function that includes a quote from
the spec.  Re-write commit message.  Fix compiler warnings:

glxdricommon.c: In function 'glxConvertConfigs':
glxdricommon.c:212:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:212:35: note: expected 'unsigned int *' but argument is of type 'int *'
glxdricommon.c:230:35: warning: pointer targets in passing argument 3 of 'core->getConfigAttrib' differ in signedness [-Wpointer-sign]
glxdricommon.c:230:35: note: expected 'unsigned int *' but argument is of type 'int *'

Signed-off-by: Daniel Czarnowski <daniel.czarnowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
2013-10-24 11:47:42 -07:00
Jon TURNEY 44d502c6f1 hw/xwin: Fix for "glx: Remove screen number from __GLXconfig"
Fix compilation after commit c3c976f54c "glx:
Remove screen number from __GLXconfig"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2013-10-09 14:51:53 +01:00
Adam Jackson 1d1484e9bd glx: Remove pixmapMode from __GLXconfig
This has never been filled in with anything meaningful afaict, and you
can't get to it from the client in any event.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2013-09-11 14:37:32 -04:00
Marc Haesen 3752a81580 hw/xwin: Remove unnecessary and incorrect HWND casts
Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-08-30 14:22:22 +01:00
Jon TURNEY 34932cef6c hw/xwin: Fix compilation of winauth.c with -Werror=implicit-function-declaration
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c: In function ‘MitGenerateCookie’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winauth.c:87:5: error: implicit declaration of function ‘MitAddCookie’ [-Werror=implicit-function-declaration]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:08 +01:00
Jon TURNEY 2a08554a0b hw/xwin: Remove unused extern g_fUseUnicode from winclipboardwndproc.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:06 +01:00
Jon TURNEY 69401f38a6 hw/xwin: Remove unneeded forward declaration of winProcessXEventsTimeout()
Remove unneeded forward declaration of winProcessXEventsTimeout(), the actual
definition immediately follows.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:03 +01:00
Jon TURNEY 9c45a1ad44 hw/xwin: Remove prototype for non-existent winDeinitClipboard()
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:59:00 +01:00
Jon TURNEY acc46fc217 hw/xwin: Remove unused externs from winclipboardwrappers.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:58 +01:00
Jon TURNEY fcc7767f8c hw/xwin: Remove unused winProcQueryTreeOrig variable
Unused since 47c7b6d3e6 "Remove no-longer needed
tricks used to prevent the clipboard client from being killed"

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:56 +01:00
Jon TURNEY 8fa882a980 hw/xwin: Fix ARGB cursor conversion on x86_64
Fix erroneous use of unsigned long * for lpBits in winXCursorToHCURSOR() which
leads to ARGB cursors being vertically streched on x86_64 by interleaving blank
rows of pixels.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:54 +01:00
Jon TURNEY 4bfb2dce5e hw/xwin: Fix an issue in winSetSpansNativeGDI() identifed by -Warray-bounds
The BITMAPINFO local only has room for a single RBGQUAD in bmiColors, but we
access two (black and white for a mono-color DIB).  Fix by changing to a dynamic
allocation big enough for a BITMAPINFO and a RGBQUAD.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:51 +01:00
Jon TURNEY 784c006adb hw/xwin: Fix -Warray-bounds warning in winXCursorToHCURSOR()
Rewrite winXCursorToHCURSOR() so access to BITMAPINFO bmiColors member doesn't
trigger an -Warray-bounds warning.

Note that the underlying storage is allocated as a BITMAPV4HEADER, so has
sufficent room for the extra RGBQUADs bmiColors after the BITMAPINFO bmiHeader.

wincursor.c: In function 'winSetCursor':
wincursor.c:293:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:294:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:295:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:296:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:297:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:298:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:299:24: error: array subscript is above array bounds [-Werror=array-bounds]
wincursor.c:300:24: error: array subscript is above array bounds [-Werror=array-bounds]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:58:49 +01:00
Marc Haesen 41d03c9ccc hw/xwin: Correct size of _WINDOWSWM_NATIVE_HWND property on x86_64
Use the correct size of a HWND on x86_64 in XChangeProperty() and
XGetWindowProperty() calls for the _WINDOWSWM_NATIVE_HWND property.

Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-08-30 12:58:15 +01:00
Colin Harrison 390cfec10e hw/xwin: Correct winprefs.c function signatures for x64.
Correct SetupRootMenu(), SetupSysMenu(), HandleCustomWM_INITMENU() and
HandleCustomWM_COMMAND() function signatures which use unsigned long parameters,
where just a specific HWND or HMENU handle type should have been used.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:56:35 +01:00
Jon TURNEY e716baedc4 Move pseudoramiX code where it can be shared between Xwin and Xquartz
Move pseudoramiX code to a separate top-level directory.  Link Xwin and Xquartz
with libPseudoramiX

I'm not sure moving this to a top-level directory is appropriate, but I'm not
sure where else it fits.

Future work: pseudoramiX can probably be consolidated with the rrxinerama code
(which I think provides fake xinerama data when real XINERAMA is disabled and we
only have one screen)

v2: fix distcheck

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:30 +01:00
Jon TURNEY ce0217b982 hw/xwin: Fix winglobals.h for MinGW64 build
Include pthread.h in winglobals.h to fix build with latest MinGW64 headers

In file included from
winmultiwindowicons.c:47:0:
winglobals.h:92:1: error: unknown type name ‘pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:27 +01:00
Jon TURNEY b27756dbe6 hw/xwin: Fix inclusion of shlobj.h in MinGW64 build
Fix build with latest MinGW64 headers by wrapping Status type in shlobj.h as well

In file included from InitOutput.c:51:0:
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1231:44: error: expected identifier or ‘(’ before ‘int’
/usr/i686-w64-mingw32/sys-root/mingw/include/shlobj.h:1248:44: error: expected identifier or ‘(’ before ‘int’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Marc Haesen <marha@users.sourceforge.net>
2013-08-30 12:52:24 +01:00
Peter Hutterer bbef8e46f2 Replace INCLUDES with AM_CPPFLAGS
newer automake gets quite noisy about this.
hw/xfree86/ddc/Makefile.am:7: warning:
'INCLUDES' is the old name for 'AM_CPPFLAGS' (or '*_CPPFLAGS')
and many more of these.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2013-08-06 13:08:13 +10:00
Jon TURNEY 43ac0491e3 hw/xwin: Fix numerous 64-bit format/type cast issues with debug printing of pointers
Numerous pieces of debug output cast a pointer to an int and then use a "%08x"
printf format.

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>
2013-07-23 23:59:44 +01:00
Colin Harrison e95bb97073 hw/xwin: Fix possible crash in winMultiWindowGetClassHint
Fix a possible crash in winMultiWindowGetClassHint() when an application doesn't
null terminate the WM_CLASS property class name (which is an ICCCM conformance
bug in the application)

(Reported for running the contiki cooja simulator in multiwindow mode, although
it seems that many Java clients may have this problem, see [1])

Based on a patch by Marc Haesen.

v2: Avoid using strnlen() which is missing on MinGW
v3: Align with Xming patch

[1] http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6961123

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2013-07-23 23:59:41 +01:00
Jon TURNEY 4bc375aa2f hw/xwin: Remove obsolete WIN_XEVENTS_SHUTDOWN
Remove obsolete WIN_XEVENTS_SHUTDOWN.  This event is never generated.

(I think the idea was to listen for WM_DELETE_WINDOW, but that's not a very
useful thing to do for a hidden window.)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:37 +01:00
Jon TURNEY 2663203cd6 configure.ac: Check for python at configure time when building XWin with AIGLX
Check for python at configure time when building XWin with AIGLX, it's used to
generate the wrapper code for native GL functions.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:34 +01:00
Jon TURNEY 9fe360bf2b hw/xwin: Avoid a null dereference if CreateDIBSection() fails in NetWMToWinIconAlpha()
Avoid a null dereference of DIB_pixels if CreateDIBSection() fails in
NetWMToWinIconAlpha()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:31 +01:00
Jon TURNEY 71b5f56302 hw/xwin: Handle WM_MOUSEHWHEEL
Handle WM_MOUSEHWHEEL tilt wheel messages, similarly to WM_MOUSEWHEEL scroll
wheel messages, to generate X button 6 and 7 presses and releases.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:27 +01:00
Jon TURNEY cf9c777ee0 hw/xwin: Map extra mouse buttons 1 and 2 to X buttons 8 and 9
Map extra mouse buttons 1 and 2 to X buttons 8 and 9, as conventional, leaving X
buttons 6 and 7 for tilt wheel.

Also add button labels for buttons 6, 7, 8 and 9 and change btn_labels in from a
dynamic allocation to a fixed one of the required size for all the labels we
use.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:24 +01:00
Jon TURNEY c9d7b9516f hw/xwin: Remove unneeded WM_XBUTTON message defines
Remove unneeded WM_XBUTTON message defines, they have been provided by w32api
for a long time now.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:21 +01:00
Jon TURNEY 5dccfc63f9 hw/xwin: Change winTranslateKey() to return it's result as it's return value
Change winTranslateKey() to return it's result as it's return value, and change
it's uses as well.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:18 +01:00
Oliver Schmidt 9b4cec76f1 hw/xwin: Consider left and right modifier keys independently on gaining focus
Handle left and right ctrl and shift keys independently

Assume that all modifiers are cleared when all keys are released on focus lost,
as internalKeyState doesn't record which modifier key was pressed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:14 +01:00
Jon TURNEY 235149d0b4 hw/xwin: Remove an extra '\n' from some log messages
Remove an extra '\n' from internal client IOError log messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:11 +01:00
Jon TURNEY c7aa9f7578 hw/xwin: _NET_WM_STATE is ATOM[] not ATOM
_NET_WM_STATE is ATOM[] not ATOM, a list of window state hints, so check all of
the atoms, not just the first one

See EWMH specifcation, section "Application Window Properties"

v2: Actually use [] on the returned atom data

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:59:08 +01:00
Jon TURNEY 682ccac90b hw/xwin: Improve WM_ENDSESSION handling using separate messaging window thread
Currently, WM_ENDSESSION just calls GiveUp() to set the DE_TERMINATE flag. But
for the X server to exit cleanly, we also need the X server dispatch loop to be
unblocked so it can notice that DE_TERMINATE has been set and exit, removing
it's lock file and any unix domain socket.

It appears that the system will terminate the process when the last UI thread in
that process returns from processing WM_ENDSESSION for the last top-level
window.

Since WM_ENDSESSION appears to sent by the system via SendMessage()
(synchronously) and the wndproc is called to process it in the message thread
for that window (the X server thread), we can't easily terminate the X server
dispatch loop from inside the WM_ENDSESSION message processing.

So, create a messaging window, a hidden, top-level window, with a separate
thread to catch this message, and process it by calling GiveUp() and then
blocking on a mutex until the X server dispatch loop exits.

Also, notice when this is a shutdown cancel WM_ENDSESSION message and take no
action.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:58:50 +01:00
Jon TURNEY 15febb05d7 Allow DDX to provide a main()
XQuartz already conditionally renames main() as dix_main() so it can provide
it's own main().  This isn't the ideal way of doing this, as it prevents libdix
built this way from being useful with any other DDX.

So instead, always name that function dix_main(), and also provide a stub main()
which just calls dix_main(), which can be overriden in the DDX.

Add a main() to XWin (XQuartz already has one, of course).

It's no longer neccessary to link XWin and XQuartz with libmain.

v2: Remove unneeded stub main hw/xwin/InitOutput.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-07-23 23:56:58 +01:00
Jon TURNEY 80054fcafb hw/xwin: Update manifest to target all architectures, not just x86
Update manifest to target all architectures, not just x86

Also: Write explicit dependencies for Xwin.rc.  XWin.exe.manifest and X.ico are
included the resource compiler output, so add a dependency on them to cause it
to be recompiled if they change.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:48:34 +01:00
Jon TURNEY 689e7ad9b0 hw/xwin: Win32 Windows properties are of pointer type HANDLE, not an integer type
Win32 Windows properties are of pointer type HANDLE, not an integer type, but we
use the Windows property WINDOW_WID_PROP to store the X window XID.

Add appropriate casts to show it doesn't matter that an XID is smaller than a
pointer on 64-bit build.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:48:31 +01:00
Jon TURNEY e1a0945e8d hw/xwin: winMultiWindowGetTransientFor() returns an XID not a WindowPtr
winMultiWindowGetTransientFor() accesses the WM_TRANSIENT_FOR property, which is
an X window XID (which we compare with WINDOW_WID_PROP) and not a WindowPtr.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:48:08 +01:00
Jon TURNEY be201ac257 hw/xwin: Change winIconIsOverride() to take a HICON parameter
Change winIconIsOverride() to take a HICON parameter, so some unneccessary
casts, which weren't portable to 64-bit Cygwin, can be removed.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:25:44 +01:00
Jon TURNEY fc40f9a92c hw/xwin: Fix uses of CreateDialogParam() for 64-bit builds
Fix uses of CreateDialogParam() to be more strictly correct, for 64-bit builds

dwInitParam parameter is LPARAM, not int
Return type of DLGPROC is INT_PTR, not WINBOOL

Also: Reporting the value of g_hDlgDepthChange is completely uninteresting, we
are just interested in GetLastError() if it is NULL

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:21:14 +01:00
Jon TURNEY b542976846 hw/xwin: deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit cygwin
The deprecated interface cygwin_conv_to_win32_path() doesn't exist in 64-bit
cygwin, but both the ID_ABOUT_CHANGELOG control and the referenced file who's
path we are converting haven't existed for a while, so just remove this unused,
cygwin-specific code.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:18:26 +01:00
Jon TURNEY 5a47c6420c hw/xwin: Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute() to an integer
Fix a 64-bit portability issue with casting HINSTANCE result of ShellExecute()
to an integer: Since HINSTANCE is a pointer type, use INT_PTR rather than int.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-06-10 15:15:44 +01:00
Jon TURNEY 5860408a19 hw/xwin: Fix unused-but-set-variable warning in ProcWindowsWMFrameGetRect()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c: In function ‘ProcWindowsWMFrameGetRect’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindowswm.c:322:12: error: variable ‘ir’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:29 +01:00
Jon TURNEY bcfd523c15 hw/xwin: Fix unused-but-set-variable warning in winMWExtWMUpdateWindowDecoration()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c: In function ‘winMWExtWMUpdateWindowDecoration’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwin32rootlesswindow.c:189:11: error: variable ‘dwStyle’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:27 +01:00
Jon TURNEY fbf819c24d hw/xwin: Fix unused-but-set-variable warning in winHotKeyAltTabPrimaryDD()
/jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c: In function ‘winHotKeyAltTabPrimaryDD’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winpfbdd.c:518:20: error: variable ‘rcSrc’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:25 +01:00
Jon TURNEY 7dae1e59ce hw/xwin: Fix unused-but-set-variable warning in winMinimizeWindow() when built !XWIN_MULTIWINDOWEXTWM
/jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c: In function ‘winMinimizeWindow’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winmultiwindowwindow.c:813:20: error: variable ‘pScreenInfo’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:23 +01:00
Jon TURNEY b284666f09 hw/xwin: Fix unused-but-set-variable warning in winClipboardProc()
/jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c: In function ‘winClipboardProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winclipboardthread.c:88:25: error: variable ‘atomClipboardManager’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:22 +01:00
Jon TURNEY d414a09bb7 hw/xwin: Fix unused-but-set-variable warning in winWindowProc()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c: In function ‘winWindowProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwndproc.c:65:22: error: variable ‘s_hInstance’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:20 +01:00
Jon TURNEY 7726102671 hw/xwin: Fix unused-but-set-variable warning in winCopyWindowNativeGDI()
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c: In function ‘winCopyWindowNativeGDI’:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.c:131:15: error: variable ‘pwinRoot’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:18 +01:00
Jon TURNEY b9a2566a6e hw/xwin: Fix unused-but-set-variable warning in winFinishScreenInitFB()
/jhbuild/checkout/xorg/xserver/hw/xwin/winscrinit.c:264:11: error: variable ‘pbits’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:16 +01:00
Jon TURNEY c97fbd39ad hw/xwin: Fix unused-but-set-variable warning in winIsFakeCtrl_L()
/jhbuild/checkout/xorg/xserver/hw/xwin/winkeybd.c:331:17: error: variable ‘lastMessage’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:14 +01:00
Jon TURNEY cdb74fe17d hw/xwin: Fix unused-but-set-variable warnings in windialog.c
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winChangeDepthDlgProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:432:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable]
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c: In function ‘winAboutDlgProc’:
/jhbuild/checkout/xorg/xserver/hw/xwin/windialogs.c:564:22: error: variable ‘s_pScreen’ set but not used [-Werror=unused-but-set-variable]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-05-02 15:43:12 +01:00
Tomasz Lis cf89aa5374 Full support of sRGB capable fbconfigs.
Changes to correctly initialize the sRGB capability attribute and
transfer it between XServer and the client. Modifications include
extension string, transferring visual config attribs and fbconfig
attribs. Also, attribute is initialized in the modules which do not
really use it (xquartz and xwin).
This version advertises both ARB and EXT strings, and initializes
the capability to default value of FALSE. It has corrected required
GLX version and does not influence swrast. The sRGB capable attribute
is attached only to those configs which do have this capability.
Both ARB and EXT versions share the same GLX extension enabling bit.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2013-03-18 10:02:00 -07:00
Keith Packard 069d8ed3eb Merge remote-tracking branch 'jturney/xserver-next' 2013-01-20 15:58:38 -08:00
Jon TURNEY d6dcde7a03 hw/xwin: Stop assuming WS_EX_APPWINDOW style in WM_SHOWWINDOW
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:50:39 +00:00
Jon TURNEY 56e94403f8 hw/xwin: Use ITaskBarList interface to ensure show-on-taskbar state is updated correctly
Use ITaskBarList interface to ensure that the taskbar notices if the window has
changed it's style in a way which affects if the taskbar shows it or not.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:50:26 +00:00
Jon TURNEY c94d1cb0a4 hw/xwin: Ensure full styling is applied when the window is mapped
Move styling update code from WM_WM_HINTS_EVENT to a function UpdateStyle(),
which is also invoked from WM_WM_MAP3, so everything which needs to be done
to style the window happens when it is mapped

(Otherwise, the appearance of the window is sensitive to the timing of the
notification of the windows appearance hint properties being set relative to
window creation. e.g. see [1])

[1] http://sourceware.org/ml/cygwin-xfree/2012-06/msg00004.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:50:20 +00:00
Jon TURNEY ef61f8cacc hw/xwin: Make sure that WM_WM_HINTS_EVENT does nothing for override-redirect windows
Future work: It looks like this code could be rationalized quite a lot: It might
make sense to pull the checking for override-redirect up out of UpdateIcon() and
UpdateName() and consolidate WM_WM_MAP2 and WM_WM_MAP3

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:56 +00:00
Jon TURNEY 3628559e59 hw/xwin: Add a new WM_WM_HINTS_EVENT event to update window style
Add a new WM_WM_HINTS_EVENT event to update window style if any of the
properties which affect window style change

Check PropertyNotify events for any of the window properties which we consider
to decide on the window style, and update the window style by sending a
WM_WM_HINTS_EVENT message to the WM.

This allows the styling of the window to change during it's lifetime.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:50 +00:00
Jon TURNEY 066ecbd11d hw/xwin: Move reshape code from winUpdateWindowPosition() to the map event handler
Move reshape code, which was only used when handling a map event, from
winUpdateWindowPosition(), to put it explicitly in the map event handler.

Remove 'reshape' parameter from winUpdatePosition().

(Note that there's no handling of the ShapeNotify event to notice when the
window shape changes, instead we hook the screen SetShape procedure and reshape
the native window then)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:15 +00:00
Ryan Pavlik 852d1fb042 hw/xwin: Add missing include xwin-config.h to winglobals.h
winglobals.h checks if RELOCATE_PROJECTROOT is defined to see if a declaration
of g_fLogFileChanged is needed, so must include xwin-config.h

Signed-off-by: Ryan Pavlik <rpavlik@iastate.edu>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-16 16:49:07 +00:00
Peter Hutterer 519d183d78 Fix two typos "requires an string value"
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2013-01-11 14:57:32 +10:00
Jon TURNEY a2037d7080 hw/xwin: Fix MinGW build of winSetAppModelID.c
Add missing #include <pthread.h>

In file included from /jhbuild/checkout/xorg/xserver/hw/xwin/winSetAppUserModelID.c:31:0:
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:140:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:141:11: error: expected declaration specifiers or ‘...’ before ‘pthread_t’
/jhbuild/checkout/xorg/xserver/hw/xwin/winwindow.h:142:11: error: expected declaration specifiers or ‘...’ before ‘pthread_mutex_t’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:13 +00:00
Jon TURNEY f57100bb36 hw/xwin: Process one Windows message per wakeup, rather than all of them.
De-queuing Windows messages and X events happens in the same thread of
execution.  Draining the windows message queue can lead to the X event queue
overflowing if lots of those windows messages cause X events (e.g. if a keyboard
macro program has just dumped thousands of keypresses into the Windows message
queue).  See the mailing list thread [1] for more details.

Processing one Windows message per wakeup, rather than all of them gives the X
server a chance to do stuff as well after each message.

[1] http://cygwin.com/ml/cygwin-xfree/2010-01/msg00056.html

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:12 +00:00
Jon TURNEY e30e1ea987 hw/xwin: Fix some comments in winkeybd.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:10 +00:00
Jon TURNEY 6f4a48f8a5 hw/xwin: Bring the X screen window to the front on a single left-click on the tray icon
Bring the X screen window to the front on a single left click on the tray icon,
like the comment says we do

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2013-01-10 15:33:08 +00:00
Yaakov Selkowitz ea1d76d1b6 Fix formatting of address operators
The formatter confused address operators preceded by casts with
bitwise-and expressions, placing spaces on either side of both.
That syntax isn't used by ordinary address operators, however,
so fix them for consistency.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
2012-12-05 18:09:48 -06:00
Keith Packard 1712a45422 Merge remote-tracking branch 'jturney/mingw-patches' 2012-11-28 07:54:13 -08:00
Yaakov Selkowitz 338bec3005 hw/xwin: Fix for MinGW-w64 DirectDraw headers
mingw-w64 headers handle NONAMELESSUNION earlier than mingw.org's, so it must be
defined before including any headers.  It also provides a ddraw.h, so use it.

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-28 14:44:14 +00:00
Yaakov Selkowitz 2c712d094a hw/xwin: use raise() instead of kill()
MinGW doesn't have kill(), so use raise() instead

Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
2012-11-28 14:44:09 +00:00
Colin Harrison 87b60efb85 hw/xwin: Don't spam MotionNotify events when the mouse hasn't moved
Don't spam MotionNotify events when the mouse hasn't moved, when polling the
mouse position outside any X window

(Test with 'xev -root' after mouse polling has started.)

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-11-27 16:26:37 +00:00
Jon TURNEY 886f4c3892 hw/xwin: Don't log all fbConfigs and GL/WGL extensions
Don't log all fbConfigs and GL/WGL extensions, unless verbose logging
is requested
Log the number of pixelFormats which gave rise to the fbConfigs

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:36 +00:00
Jon TURNEY 9b10f20f47 hw/xwin: Use pre-computed extent of damage for creating GDI region
When -clipupdates option is specified, use the pre-computed extent of damage,
rather than computing a GDI region which combines all the individual boxes in
the damage.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:34 +00:00
Jon TURNEY 3ab95a2a5c hw/xwin: Ensure we own the clipboard before checking the format of it's contents
Ensure we own the clipboard before checking the format of it's contents, this
prevents the contents from changing underneath us.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:33 +00:00
Colin Harrison a4f357c620 hw/xwin: Disable minimize button on window with skip-taskbar state
If a window has had its taskbar button removed, disable its minimize
button to prevent it becoming lost

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-11-27 16:26:32 +00:00
Jon TURNEY a2983452ee hw/xwin: Process _NET_WM_STATE_SKIP_TASKBAR hint in multiwindow mode.
Set WS_EX_TOOLWINDOW style to hide window from Alt-Tab switcher

Use ITaskBarList interface to ensure that the taskbar notices if the window has
changed it's style in a way which affects if the taskbar shows it or not

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:26:30 +00:00
Jon TURNEY de759cc38c hw/xwin: Add a simple interface to the ITaskbarList COM interface
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:12 +00:00
Jon TURNEY 19d875187a hw/xwin: Enable RANDR resize by default
Also fix erroneous use of '--resize' not '-resize', and document '-noresize' in man page

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:11 +00:00
Yaakov Selkowitz 4445806732 hw/xwin: Enable AIGLX by default
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-11-27 16:09:09 +00:00
Oliver Schmidt 11bb32e561 hw/xwin: Restore non-latching modifier key state when an X window gains focus
In multiwindow mode, the state of the modifier keys was lost when a window is
created (or raised) and focus moved to that window.

For example: In window A Ctrl + some key opens a window B, then in window B Ctrl
+ some other key triggers the next action. However after the opening of window B
the Ctrl key has to be released and pressed again. If the user keeps the Ctrl
key held down when the window B is opened, the next key press X will be
interpreted as X and not as Ctrl+X.

Extended the function winRestoreModeKeyStates in winkeybd.c to consider not only
the latching modifier keys but also the modifiers Ctrl, Shift, Alt/AltGr by
using the Windows function GetAsyncKeyState.

A combined Ctrl+AltGr modifier state cannot be restored correctly, as Windows
always fakes a Ctrl-L when AltGr is pressed.

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>
2012-11-27 16:09:08 +00:00
Jon TURNEY 47291d0b7d hw/xwin: Give our logical xor operator a more logical name
Also, rather than a comment about why we need a logical operator, let's have a
comment about what we are doing to the keyboard state...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:09:06 +00:00
Tobias Häußler 8aa27ae821 hw/xwin: Add correct taskbar grouping of X windows on Windows 7
I created a small patch for XWin that adds correct grouping of taskbar icons
when 'Always combine, hide labels' is set in the taskbar properties. It uses the
new taskbar APIs introduced in Windows 7 to set an application id for each
window. The id is based on the X11 class hints.

v2: Add file to _SOURCES to fix distcheck

v3 : Fix compilation with mingw-w64 w32api headers
Include propkey.h, propsys.h rather than defining necessary stuff ourselves

v4: Fix up names taskbar->propertystore, AppID->AppUserModelID, etc.
Link directly with ole32 for PropVariantClear(), prototyping it if neccessary.

v5: Put winSetAppUserModelID()-related code in a separate file.
Drop a superfluous assign to hr of ignored HRESULT of SetValue()

Signed-off-by: Tobias Häußler <tobias.haeussler@gmx.de>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 16:08:22 +00:00
Jon TURNEY f3aef7f956 hw/xwin: Fix function name in log message
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 14:37:16 +00:00
Jon TURNEY 127a7068b7 hw/xwin: Allow XScreenSaverSuspend() to effect Windows screen saver or monitor power off
Reset the idle timer in the block handler if screenSaverSuspended is set.

This isn't quite a complete solution.  We should also set the block timeout to
something less than the idle timer timeout to ensure we will reset the idle
timer before it times out if we are blocking.

The idle timer timeout is presumably the first one to expire of the screen saver
activation or monitor low power or power down timeout, depending on
configuration.

Unfortunately this is probably not straightforward to do. Whilst
SystemParametersInfo(SPI_GETSCREENSAVETIMEOUT) is portable, apparently
SPI_GETLOWPOWERTIMEOUT and SPI_GETPOWEROFFTIMEOUT are not supported by Windows
versions 6.0 or later, and the interface for discovering equivalent value is
complex.

This doesn't matter in the case where a media player or similar application is
the one making the XScreenSaverSuspend() requests, as it will be continuously
drawing, causing the X server to become unblocked often.

In the case where slide show presentation application or similar is the one
making the XScreenSaverSuspend() request, this might be a problem.

Since "Powerpoint is Evil" [1], I think we'll leave it like this till someone
complains :-)

[1] http://www.edwardtufte.com/tufte/books_pp

v2: conditionalize on SCREENSAVER

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 14:37:00 +00:00
Jon TURNEY 190f165317 hw/xwin: Avoid logging an extra blank line if BUILDERSTRING is empty
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 13:49:34 +00:00
Jon TURNEY ef9dbea24f hw/xwin: Report which drawing engines are being enabled when checking for support
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 13:49:11 +00:00
Jon TURNEY 5824166256 hw/xwin: Show any fatal error message
Report the fatal error message in the dialog we pop up, rather than just
referring the user to the logfile.

v2: Do this a better way since the "Pass the FatalError message to
OsVendorFatalError" patch has landed, and OsVendorFatalError() now gets passed
the fatal error message

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-11-27 13:48:44 +00:00
Keith Packard 04f980ead5 Merge remote-tracking branch 'jturney/mingw-w64-w32api' 2012-11-05 08:45:21 -08:00
Jon TURNEY a4941ce496 hw/xwin: Wrap 'Status' when including ddraw.h
Status is #defined as an alias for a type in xkbsrv.h, which conflicts with it's
use as a parameter name in rpcdce.h

This fixes compilation with MinGW-w64 w32api headers

(The MinGW-w64 w32api headers actually provide a ddraw.h, so this fix tries to
do things in a way which will still work if our private copy of ddraw.h is
eventually removed)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by:  Colin Harrison <colin.harrison@virgin.net>
2012-11-05 11:14:54 +00:00
Jon TURNEY 57bbf6e2ae hw/xwin: Remove pointless winFinishCreateWindowsWindowDDNL()
Remove pointless winFinishCreateWindowsWindowDDNL() and the useless DirectDraw
surface pointers in the window privates

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by:  Colin Harrison <colin.harrison@virgin.net>
2012-11-05 11:14:45 +00:00
Jon TURNEY 5bc4c53d23 hw/xwin: Link with libdxguid rather than defining the DirectX GUIDs ourselves
Decruftify by linking with libdxguid rather than defining the DirectX GUIDs
ourselves. This fixes compilation with MinGW-w64 w32api headers, which do not
provide GUID_SECT (which only ever did anything for gcc prior to 2.95, anyhow)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by:  Colin Harrison <colin.harrison@virgin.net>
2012-11-05 11:14:21 +00:00
Colin Harrison 74735c5ebf hw/xwin: fmemopen is available on cygwin but not MinGW
This is a follow-up to commit 0659437f5e.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-10-29 12:22:07 +00:00
Colin Harrison 0e85e5e628 hw/xwin: Fix no return value warning in winClipboardProc()
winclipboardthread.c: In function ‘winClipboardProc’:
winclipboardthread.c:415:9: warning: ‘return’ with no value, in function returning non-void
winclipboardthread.c:424:13: warning: ‘return’ with no value, in function returning non-void

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-17 13:18:42 +01:00
Colin Harrison 51ed6a7d46 hw/xwin: Remove unused variable in winmultiwindowwm.c
winmultiwindowwm.c: In function ‘UpdateName’:
winmultiwindowwm.c:522:14: warning: unused variable ‘pszName’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-17 13:18:41 +01:00
Colin Harrison 5886b1dc4d hw/xwin: Remove unused variables in winwindow.c
winwindow.c: In function ‘winCreateWindowNativeGDI’:
winwindow.c:62:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winDestroyWindowNativeGDI’:
winwindow.c:85:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winPositionWindowNativeGDI’:
winwindow.c:108:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winChangeWindowAttributesNativeGDI’:
winwindow.c:213:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winUnmapWindowNativeGDI’:
winwindow.c:241:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]
winwindow.c: In function ‘winMapWindowNativeGDI’:
winwindow.c:265:19: warning: unused variable ‘pWinPriv’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-17 13:18:39 +01:00
Colin Harrison 08b33882f3 hw/xwin: Remove unused variables in winvalargs.c
winvalargs.c: In function ‘winValidateArgs’:
winvalargs.c:62:10: warning: unused variable ‘fImplicitScreenFound’ [-Wunused-variable]
winvalargs.c:60:9: warning: unused variable ‘iMaxConsecutiveScreen’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-17 13:18:17 +01:00
Colin Harrison 7e665f1a21 hw/xwin: Remove unused variables in winwindowswm.c
winwindowswm.c: In function ‘ProcWindowsWMQueryVersion’:
winwindowswm.c:85:9: warning: unused variable ‘n’ [-Wunused-variable]
winwindowswm.c: In function ‘SProcWindowsWMQueryVersion’:
winwindowswm.c:565:9: warning: unused variable ‘n’ [-Wunused-variable]

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-16 22:40:13 +01:00
Jon TURNEY e59cc83bcd hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winmsg.c
winmsg.c: In function ‘winVMsg’:
winmsg.c:47:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDrvMsg’:
winmsg.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winMsg’:
winmsg.c:66:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDrvMsgVerb’:
winmsg.c:77:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winMsgVerb’:
winmsg.c:87:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winErrorFVerb’:
winmsg.c:97:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winDebug’:
winmsg.c:107:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winmsg.c: In function ‘winTrace’:
winmsg.c:117:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 22:29:53 +01:00
Jon TURNEY 3d6e6a394e hw/xwin: Use X_ATTRIBUTE_PRINTF where suggested for winerror.c
Also, fix the typoed name OsVenderVErrorF (sic), so it actually gets prototyped
and remove redundant declarations of it's prototype.

winerror.c: In function ‘OsVendorVErrorF’:
winerror.c:56:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]
winerror.c: In function ‘winMessageBoxF’:
winerror.c:104:5: warning: function might be possible candidate for ‘gnu_printf’ format attribute [-Wmissing-format-attribute]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 22:29:51 +01:00
Jon TURNEY 13fb6b36b8 hw/xwin: Use char strings in winClipboardUNIXtoDOS for consistency with the rest of the clipboard code
winclipboardxevents.c: In function ‘winClipboardFlushXEvents’:
winclipboardxevents.c:575:13: warning: passing argument 1 of ‘winClipboardUNIXtoDOS’ from incompatible pointer type
winclipboard.h:102:2: note: expected ‘unsigned char **’ but argument is of type ‘char **’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 22:29:50 +01:00
Jon TURNEY fa36a7cd48 hw/xwin: Fix warning about discarding const in initializing winKBLayouts
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
winlayouts.h:46:5: warning: initialization discards qualifiers from pointer target type
[repeated for each layout]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 22:29:49 +01:00
Jon TURNEY 0ea65df8a5 hw/xwin: Fix some of the warnings in generated gl wrapper code
Fix some of the warnings in generated gl wrapper code:
- glWinResolveHelper takes a const char * argument
- ensure formal parameter names don't collide with reserved names or shadow
global declarations (e.g. near, far, index (from string.h), remainder (from
math.h), pointer (from Xdefs.h) by postpending a '_'.

generated_gl_wrappers.c:13:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
glwrap.c:70:1: note: expected 'char *' but argument is of type 'const char *'
[repeated many times]
generated_gl_wrappers.c: In function 'glVertexAttrib1dARBWrapper': generated_gl_wrappers.c:6884:47: warning: declaration of 'index' shadows a global declaration [-Wshadow]
generated_gl_wrappers.c:6886:3: warning: passing argument 2 of 'glWinResolveHelper' discards qualifiers from pointer target type
[repeated many times]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 22:29:48 +01:00
Colin Harrison f7f0739311 hw/xwin: Warning fix in ProcWindowsWMFrameSetTitle()
winwindowswm.c: In function ‘ProcWindowsWMFrameSetTitle’:
winwindowswm.c:514: error: pointer targets in passing argument 2 of ‘strncpy’ differ in signedness

If you're going to stick random casts into your code, at least use the goddammed
right ones. :-)

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-10-16 22:25:08 +01:00
Jon TURNEY 97c9ed026a hw/xwin: Fix shadowed local variable i in HandleCustomWM_COMMAND()
Fix shadowed local variable i in HandleCustomWM_COMMAND()

Also, fds are meant to be representable as an int

winprefs.c: In function ‘HandleCustomWM_COMMAND’:
winprefs.c:346:23: error: declaration of ‘i’ shadows a previous local
winprefs.c:322:7: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:26:11 +01:00
Jon TURNEY b55d0b92fc hw/xwin: Fix shadowed local variables in winLoadCursor()
Move shadowed local variables x and y to the places they are used

wincursor.c: In function ‘winLoadCursor’:
wincursor.c:212:11: error: declaration of ‘x’ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:212:14: error: declaration of ‘y’ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here
wincursor.c:228:11: error: declaration of ‘x’ shadows a previous local
wincursor.c:166:7: error: shadowed declaration is here
wincursor.c:228:14: error: declaration of ‘y’ shadows a previous local
wincursor.c:166:10: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:25:45 +01:00
Jon TURNEY a8c9c3699e hw/xwin/glx: Fix using Mask as a formal parameter shadows a global typedef of the same name
Fix using Mask as a formal parameter shadows the typedef of the same name from X.h

indirect.c: In function 'GetShift':
indirect.c:1629:14: warning: declaration of 'Mask' shadows a global declaration [-Wshadow]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:25:21 +01:00
Jon TURNEY 47df98c785 hw/xwin: Fix using screenInfo as a formal parameter to InitOutput() shadows a global declaration
Using screenInfo as a formal parameter to InitOutput() shadows a global declaration of screenInfo.
Change the formal parameter name from screenInfo to pScreenInfo, as everywhere else uses.

InitOutput.c: In function ‘InitOutput’:
InitOutput.c:891:25: error: declaration of ‘screenInfo’ shadows a global declaration
../../include/scrnintstr.h:570:19: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:24:55 +01:00
Jon TURNEY 97e9c34687 hw/xwin: Fix using menu as a formal parameter shadows a global variable of the same name
Using menu as a formal parameter shadows a global variable of the same name

winprefsyacc.y: In function ‘SetRootMenu’:
winprefsyacc.y:286:20: error: declaration of ‘menu’ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here
winprefsyacc.y: In function ‘SetDefaultSysMenu’:
winprefsyacc.y:293:26: error: declaration of ‘menu’ shadows a global declaration
winprefsyacc.y:55:19: error: shadowed declaration is here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:24:23 +01:00
Jon TURNEY efe96a17bd hw/xwin: Fix using index as a formal parameter shadows index()
Using index as a formal parameter shadows index() from strings.h

winallpriv.c: In function ‘winInitCmapPrivates’:
winallpriv.c:119:45: error: declaration of ‘index’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:23:54 +01:00
Jon TURNEY 451c5d9175 hw/xwin: Fix using index as a formal parameter in winscrinit.c shadows index()
Using index as a local variable shadows index() from strings.h

winscrinit.c: In function ‘winFinishScreenInitFB’:
winscrinit.c:274:28: error: declaration of ‘index’ shadows a global declaration
winscrinit.c: In function ‘winFinishScreenInitNativeGDI’:
winscrinit.c:623:35: error: declaration of ‘index’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:23:29 +01:00
Jon TURNEY 21faee4b38 hw/xwin: Fix using index as a local variable shadows index()
Using index as a local variable shadows index() from strings.h

winprefs.c: In function ‘LoadImageComma’:
winprefs.c:574:7: error: declaration of ‘index’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:23:05 +01:00
Jon TURNEY 2d9123fd0c hw/xwin: Fix using index as a formal parameter in winmonitors.c shadows index()
Fix using index as a local variable shadows global declaration of index() from strings.h

winmonitors.c: In function ‘QueryMonitor’:
winmonitors.c:59:23: error: declaration of ‘index’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:22:40 +01:00
Jon TURNEY 5b0435dbda hw/xwin: Fix using system as a local variable in winCheckMount() shadows system()
Using system as local variable in winCheckMount() shadows the global declaration of system() from stdlib.h

InitOutput.c: In function ‘winCheckMount’:
InitOutput.c:296:10: error: declaration of ‘system’ shadows a global declaration

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:22:16 +01:00
Jon TURNEY 17d84c743d hw/xwin: Remove obsolete redundant declarations of winPushPixels()
winPushPixels() and winpushpxl.c was removed in it's entirety in commit
f31bd087e8 "Death to mfb"

wingc.c:37:1: error: redundant redeclaration of ‘winPushPixels’
win.h:1104:1: note: previous declaration of ‘winPushPixels’ was here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:21:50 +01:00
Jon TURNEY f06b468d96 hw/xwin: Fix redundant declarations in winmultiwindowwm.c
winmultiwindowwm.c:139:14: error: redundant redeclaration of ‘display’
../../include/opaque.h:52:14: note: previous declaration of ‘display’ was here
winmultiwindowwm.c:140:13: error: redundant redeclaration of ‘ErrorF’
../../include/os.h:558:13: note: previous declaration of ‘ErrorF’ was here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:19:35 +01:00
Jon TURNEY 3e8269177e hw/xwin: Fix redundant declarations in winclipboardwrappers.c
Fix redundant declarations in winclipboardwrappers.c.
Also remove obsolete winProcQueryTree() prototype.

winclipboardwrappers.c:64:12: error: redundant redeclaration of ‘g_iNumScreens’
winglobals.h:33:12: note: previous declaration of ‘g_iNumScreens’ was here
winclipboardwrappers.c:67:13: error: redundant redeclaration of ‘g_fXdmcpEnabled’
winglobals.h:45:13: note: previous declaration of ‘g_fXdmcpEnabled’ was here
winclipboardwrappers.c:75:27: error: redundant redeclaration of ‘winProcEstablishConnectionOrig’
winglobals.h:66:27: note: previous declaration of ‘winProcEstablishConnectionOrig’ was here
winclipboardwrappers.c:76:27: error: redundant redeclaration of ‘winProcQueryTreeOrig’
winglobals.h:67:27: note: previous declaration of ‘winProcQueryTreeOrig’ was here
winclipboardwrappers.c:77:27: error: redundant redeclaration of ‘winProcSetSelectionOwnerOrig’
winglobals.h:68:27: note: previous declaration of ‘winProcSetSelectionOwnerOrig’ was here

winclipboardwrappers.c:56:5: warning: redundant redeclaration of ‘winProcEstablishConnection’ [-Wredundant-decls]
winclipboardwrappers.c:52:5: note: previous declaration of ‘winProcEstablishConnection’ was here
winclipboardwrappers.c:57:5: warning: redundant redeclaration of ‘winProcSetSelectionOwner’ [-Wredundant-decls]
winclipboardwrappers.c:54:5: note: previous declaration of ‘winProcSetSelectionOwner’ was here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:19:00 +01:00
Jon TURNEY 0975fa0b39 hw/xwin: Fix redundant declaration in winclipboardthread.c
winclipboardthread.c:51:22: error: redundant redeclaration of ‘serverGeneration’
../../include/misc.h:362:22: note: previous declaration of ‘serverGeneration’ was here
winclipboardthread.c: In function ‘winClipboardProc’:

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:18:36 +01:00
Jon TURNEY 4a1da00c49 hw/xwin: Fix redundant declaration in winclipboardinit.c
In file included from winclipboardinit.c:35:0:
winclipboard.h:81:13: error: redundant redeclaration of ‘ErrorF’
../../include/os.h:558:13: note: previous declaration of ‘ErrorF’ was here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:18:11 +01:00
Jon TURNEY 30f31b80f0 hw/xwin: Fix various warnings in code generated by lex/yacc
Remove various redundant declarations.

Instruct lex not to generate code which isn't going to be used, thus avoiding
some unused function warnings.

Note that bison <2.5 expects stdlib.h to define _STDLIB_H if it's been included,
and avoids prototyping free/malloc in that case. Some stdlib.h (e.g. newlib) may
not match precisely (e.g. defining _STDLIB_H_), so we define it after including
stdlib.h to be sure, and avoid a redudant declaration warning for those symbols.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:17:35 +01:00
Jon TURNEY 4231b9541c hw/xwin: Fix redundant declaration in winprefs.c
winprefs.c:63:14: error: redundant redeclaration of ‘display’
../../include/opaque.h:52:14: note: previous declaration of ‘display’ was here

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:16:55 +01:00
Jon TURNEY 70087c55ff hw/xwin: Fix redundant declaration warnings in winmonitors.c
Include xwin-config.h so HAVE_STRLCPY and HAVE_STRNDUP are defined, so
duplicate declarations of strlcpy(), strlcat() and strndup() aren't made
by os.h

In file included from ../../include/misc.h:111:0,
                 from ../../include/screenint.h:51,
                 from ../../include/scrnintstr.h:51,
                 from win.h:157,
                 from winmonitors.c:31:
../../include/os.h:491:15: error: redundant redeclaration of ‘strlcpy’
/usr/include/string.h:86:35: note: previous declaration of ‘strlcpy’ was here
../../include/os.h:492:15: error: redundant redeclaration of ‘strlcat’
/usr/include/string.h:85:35: note: previous declaration of ‘strlcat’ was here
../../include/os.h:496:15: error: redundant redeclaration of ‘strndup’

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:16:20 +01:00
Jon TURNEY 9904c8fe75 hw/xwin: Remove completely unused winregistry.c
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-16 21:15:54 +01:00
Jon TURNEY a69429a17b Fix 'make distcheck' for hw/xwin
Add some missing header files to _SOURCES so they get distributed properly

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2012-10-11 12:54:12 +01:00
Jon TURNEY 25741b1aa3 hw/xwin: Only add GLX extension once.
Using of LoadExtension() to add GLX onto to the end of the list of extensions on
every server regeneration leads to hilarious consequences (i.e. crashing) after
the first regeneration :-)

Possibly xf86ExtensionInit() and QuartzExtensionInit() need a similar fix.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tested-by: Colin Harrison <colin.harrison@virgin.net>
2012-10-11 12:54:10 +01:00
Keith Packard 4dd5989d15 Merge remote-tracking branch 'ajax/server-1.14-abi-churn' 2012-09-24 11:43:01 -07:00
Daniel Martin 76d8739b1f dix: Remove #includes of mibstore.h
Remove more backing store leftovers.

Reviewed-by: Aaron Plattner <aplattner@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-09-23 10:31:27 -07:00
Adam Jackson ff8e3ad807 dix: Pull client-is-local flag up to the ClientRec
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-09-20 14:36:39 -04:00
Keith Packard 7d87545ba7 Merge remote-tracking branch 'jturney/master' 2012-08-06 15:11:13 -07:00
Marc Haesen f6e7b82aca hw/xwin: Fixes to pixelFormat <-> fbConfig conversion in WGL mode
Fix FIXME in fbConfigToPixelFormat() to correctly populate RGBA-mask shift
parameters.  Also request colourindex pixelFormats correctly.

Now that they are requested correctly, don't skip colorindex visuals when
converting pixelFormats to fbConfigs.

Populate transparent colour information when converting pixelFormat from
DescribePixelFormats() to a fbConfig.

Signed-off-by: Marc Haesen <marha@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:58:08 +01:00
Jon TURNEY 45c432871d hw/xwin: Introduce winProcessXEventsTimeout() to the concept of fractions of a second
Oh this is terrible.

Currently we only compute the select timeout in whole seconds.  This means if we
have less than 1 second remaining, we select with a timeout of 0 (i.e. poll)
which causes the task to spin, burning 100% CPU for the remaining timeout (and
possibly preventing the process we are waiting for from running :S)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:48:09 +01:00
Jon TURNEY 23cd4d0174 hw/xwin: Fix winUpdateWindowPosition() not to assume WS_EX_APPWINDOW style
Also improve it's debug output a bit

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:47:59 +01:00
Jon TURNEY 527cf13135 hw/xwin: Make winOverrideIcon() thread-safe for icon data access
winOverrideIcon() is called from the internal WM client thread.

Accessing server-internal data structures to get icon data or window hints is
not safe, as there is no lock to ensure we do not collide with these data
structures being updated in the server thread.

Rewrite so the internal client thread uses X client calls to obtain this data
safely

We used to also set the icon inside the server when the window was initially
created.  For simplicity, we simply send a message to the internal WM to update
the icon when the window is created (rather than writing different icon update
code which can work in the server thread for that one case...)

extwm mode used to do the icon update in the server. I'm not sure that actually
made much sense.  Let's assume the external WM client can do it instead...

v2
Make sure that WM_WM_ICON_EVENT does nothing for override-redirect windows

v3
Reinstate check that native window actually has expected properties for an X
window before trying to update it's icon; some auxiliary windows owned by the
XWin process don't, which would cause a crash

v4
Various fixes to pixmap icon conversion:
- remove left-over malloc in winScaleXimageToWindowsIcon causing a memory leak
- don't recalculate DDBitmap stride in winScaleXimageToWindowsIcon, when we already have worked it out
- properly check that XGetWindowProperty(NET_WM_ICON) returned some data
- don't try to retrieve WM_HINTS icon_mask if it isn't set
- restore accidentally dropped calculation of effBpp, stride, maskStride of output DDBitmap
- make sure imageMask is zero-initalized before we use it to mask the DDBitmap

v5
Remove a left-over unused variable

v6
Avoid XDestroyImage(NULL) crash if XGetImage failed for icon_pixmap

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:47:42 +01:00
Jon TURNEY 2677d89823 hw/xwin: Also update icon when _NET_WM_ICON property changes
_NET_WM_ICON property is also considered to decide on the window icon, so also
send a WM_WM_ICON_EVENT message to the WM if the PropertyNotify event is for
_NET_WM_ICON property

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:47:27 +01:00
Jon TURNEY a07541f1ff hw/xwin: Rename WM_WM_HINTS_EVENT to WM_WM_ICON_EVENT
WM_WM_HINTS_EVENT only updates the icon, so rename it to WM_WM_ICON_EVENT

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:47:14 +01:00
Jon TURNEY 2a47c91eb3 hw/xwin: Refactor Xutf8TextPropertyToString() from GetWindowName() as a separate utility function
Simplify GetWindowName() by moving UTF-8 to wchar conversion out to it's call
site.  This allows us to do extra processing on the window name in future.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-08-03 22:46:18 +01:00
Dave Airlie aad428b8e2 glx: drop GLX_LIBS from X server and workaround sdksyms.
We've had reports of two copies of the GLX bits, one in the server
and one in libglx.so causing problems, I didn't understand why the
X server needed a copy so drop it, however then we have to fix a missing
GlxExtensionInit that comes from sdksyms, so work around it by moving
that one declaration into a header that sdksyms doesn't scan.

Thanks to Jon Turney for debugging the actual problem.
(copyright header from extinit.h that seems most appropriate put on top).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52402
Tested-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Tested-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-07-25 23:30:53 -07:00
Jon TURNEY 357ec54f46 hw/xwin: Refer to xkeyboard-config man page for XKB configuration option values
Also polish the keyboard configuration text a bit
Include man section number in references to setxkbmap
Consistently refer to 'manual page' rather using both that and 'man page'

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:59:40 +01:00
Jörg Mensmann 5940580f8c hw/xwin: Fix command line arguments for multiple monitors.
Moving Xwin to a certain monitor using "-screen 0 @2" would fail,
printing "ddxProcessArgument - screen - Querying monitors failed".

This happened since commit 3ead1d810b,
because EnumDisplayMonitor() returns FALSE if its callback function
returns FALSE (which is not clearly documented), and QueryMonitor()
would then also return FALSE.

Moving back to the old behaviour, where the return value of
EnumDisplayMonitors() is ignored.

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:59:29 +01:00
Jon TURNEY 18801f5e5a hw/xwin: Remove unused WindowExposuresProcPtr storage in screen private
We don't wrap the WindowExposures screen function

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:59:02 +01:00
Jon TURNEY 8fd30859c2 hw/xwin: Remove long obsolete README for hw/xwin
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:57:06 +01:00
Jon TURNEY 3568d4af4f hw/xwin: Remove a pointless OS version check in winInstallKeyboardHookLL()
Checking for OS later than NT4 SP3 (which we didn't do correctly anyhow,
just checking for NT) is pointless when other code in hw/xwin assumes at
least NT 5.0

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:56:54 +01:00
Jon TURNEY 0ed0d39790 hw/xwin: Remove winClipboardDetectUnicodeSupport()
This code for detecting if the Windows clipboard can support unicode
is long obsolete.

All NT versions of Windows support unicode clipboard, so any version
of Windows we can run on must support unicode clipboard.

The -nounicodeclipboard flag to disable use of unicode on the clipboard
is retained.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:56:31 +01:00
Jon TURNEY c98471fad7 hw/xwin: Consolidate duplicated code as getHwnd() function
Consolidate code to find the native HWND of an X window, stored in the _WINDOWSWM_NATIVE_HWND
property, duplicated in UpdateName() and PreserveWin32Stack() as getHwnd()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:55:49 +01:00
Jon TURNEY df7636dddb hw/xwin: Correct function name in log message
Correct function name in log message winInitializeDefaultScreens -> winInitializeScreenDefaults

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:55:26 +01:00
Jon TURNEY 9cdd3ed074 hw/xwin: Tidy up some more pointless output which is always emitted
It's not very useful to log lines like the below when the About.. dialog is used

winAboutDlgProc - WM_COMMAND - IDOK or IDCANCEL
winAboutDlgProc - WM_CLOSE

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:55:02 +01:00
Colin Harrison eb5b4d8d80 hw/xwin: RANDR resize didn't occur when screen window was maximized or restored
In windowed mode, with option -resize, RANDR resize was missing when the screen
window was maximized or restored.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-07-16 13:54:39 +01:00
Jon TURNEY 7e07d61857 hw/xwin: Bug fixes for screen sizing when the screen window is on a non-primary monitor
There is a bug that when the -screen option is used to specify a monitor for
the screen window to be located on, but no explicit size is specified
(and the -multiplemonitors option isn't specified), the screen
window size is always constrained to fit the work area of the primary
monitor (rather than the work area of the specified monitor)

This gives incorrect results if you want a screen the same size as your
non-primary monitor (e.g. by using -screen 0 @2) and your non-primary
monitor is larger than your primary monitor.

(This can be worked around by specifying -multiplemonitors and an explicit
screen size the same size as the monitor (e.g. -multiplemonitors -screen 0
1600x1200@2))

Fix to use work area for the monitor specified for the screen, rather than the
primary monitor work area (unless -multiplemonitors is used, in which case we
continue to use the virtual desktop work area instead)

Also fix the adjustment for an autohide taskbar, so that it is only done if the
taskbar is on the same monitor as the screen (or -multiplemonitors is used)

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:54:15 +01:00
Jon TURNEY 090856b55b hw/xwin: Tidy up some pointless output which is always emitted
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:52:37 +01:00
Jon TURNEY 9fe9c5f868 hw/xwin: Don't bother reporting XORG_VERSION_CURRENT
Don't bother reporting XORG_VERSION_CURRENT, when we also
report the version number broken down into it's components
XORG_VERSION_MAJOR, XORG_VERSION_MINOR, etc. as well.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-16 13:51:58 +01:00
Jon TURNEY 2b74949ad0 Restore GLX extension to XWin
- Add an XwinExtensionInit(), similar in spirit to QuartzExtensionInit()
and xf86ExtensionInit()
- Load the GLX extension (I'm guessing XQuartz needs this adding somewhere
as well)
- Also, since we now have a proper place to install the native GL provider
where it will take priority over the the swrast provider, do so

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-07-12 17:48:06 +01:00
Alan Coopersmith 789d64e19a Remove unneccesary casts from WriteToClient calls
Casting return to (void) was used to tell lint that you intended
to ignore the return value, so it didn't warn you about it.

Casting the third argument to (char *) was used as the most generic
pointer type in the days before compilers supported C89 (void *)
(except for a couple places it's used for byte-sized pointer math).

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
Tested-by: Daniel Stone <daniel@fooishbar.org>
2012-07-09 19:12:56 -07:00
Jon TURNEY c9bbf8fe57 hw/xwin/glx: Fix glxWinCreateContext() function pointer mismatch
Fix glxWinCreateContext() function signature to align with commit 96d74138
"glx: Extend __GLXscreen::createContext to take attributes", which added more
parameters to the screen createContext function for implementing GLX_ARB_create_context

indirect.c: In function 'glxWinScreenProbe':
indirect.c:683:36: warning: assignment from incompatible pointer type

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-06-21 19:52:44 +01:00
Jon TURNEY 6e85660c75 hw/xwin/glx: Update gen_gl_wrappers.py for the current glx/dispatch.h
Fix the code generator for the dispatch table initialization after
the whitespace/coding style changes to glx/dispatch.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-06-21 19:35:10 +01:00
Jon TURNEY cb638ed9c8 hw/xwin/glx: Blacklist 'GDI generic' GL renderer
If the native GL renderer is the GDI generic renderer (as can happen
if we are in safe mode, or the video driver is VGA, or we have hybrid
graphics which hasn't noticed that xwin requires 3d acceleration), don't
use it.  It's not accelerated and we will probably get better conformance
and perfomance from swrast.

Fix so we don't install screen function wrappers in glxWinScreenProbe
unless we are succesful.

Also, move fbConfig dumping to after GLX version has been determined
from extensions

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-06-21 18:59:04 +01:00
Jon TURNEY 8c24d20933 hw/xwin/glx: Fix glxLogExtensions to handle a null string without crashing
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-06-21 18:36:40 +01:00
Jon TURNEY c08c7c8f65 hw/xwin/glx: Create a new dispatch table rather than modifying the existing one
Create a new dispatch table rather than modifying the existing one

struct _glapi_table is not a complete type after including glapi.h, so we use
glapi_get_dispatch_table_size() to determine it's size (alternatively, we could
include glapitable.h, to complete the type)

This could possibly be written to use _glapi_create_table_from_handle() instead, but
that requires making all the wrapper functions exports

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-06-21 18:36:17 +01:00
Dave Airlie 812786f4d4 xwin: fixup block/wakeup handlers
These got missed out in the api changeover.

Reported-by: Colin Harrison <colin.harrison@virgin.net>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
2012-06-05 13:02:38 -07:00
Dave Airlie 1f0e8bd5eb api: rework the X server driver API to avoid global arrays.
This is a squash merge containing all the API changes, as
well as the video ABI bump.

Its been squashed to make bisection easier.

Full patch log below:

commit b202738bbf0c5a1c1172767119c2c71f1e7f8070
Author: Aaron Plattner <aplattner@nvidia.com>
Date:   Mon May 14 15:16:11 2012 -0700

    xfree86: Bump video ABI to 13.0

    The ABI was broken by changes to convert from screen index numbers to ScreenPtr
    / ScrnInfoPtr in various structures and function signatures.

    Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Dave Airlie <airlied@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d5f7d9f8d408bcad3f83277d255f25d3b0edbf3
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 10:56:57 2012 +0100

    xf86: xf86ClearEntityListForScreen should take a pScrn

    When adding GPU screens this make life easier.

    (also fix comment, as pointed out by Alan)

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit afee8b5ab4501597ecc1ade34124d7ca227ab055
Author: Dave Airlie <airlied@redhat.com>
Date:   Thu May 24 07:07:32 2012 +0100

    xf86i2c: add pscrn for drivers to use

    This just adds a pScrn pointer into the struct for the drivers to use
    instead of scrnIndex. Mostly scrnIndex is used for logging, but some
    drivers use it to lookup xf86Screens, so let them stash a pScrn instead.

    Removing the scrnIndex is a bit more involved and I'm not sure its worth
    the effort. Doing i2c in the X server is legacy code as far as I'm concerned.

    Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit ea5092f1f679691d187f1eee9427e6057beec56e
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 19:25:20 2012 +0100

    dix/gc: consolidate GC object creation in one place

    The standard GC create and scratch GC create were 90% the same really,
    and I have a need in the future for creating GC objects without the
    other bits, so wanted to avoid a third copy.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3d91482ea9b4883e64e496f2768168e0ffa21ba1
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 10:24:06 2012 +0100

    xf86: add a define to denote the new non-index interfaces are being used

    This can be used by drivers to provide compatible APIs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 37c3ae3e6cd4f3dedc72f371096d6743f8f99df3
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 15:09:12 2012 +0100

    dix: make Create/Free scratch pixmaps take a ScreenPtr

    While technically an API/ABI change I doubt anyone uses it,
    but it helps in splitting screens up.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 75f2062a3fe94f04764ecc7d2ff2fbbeccb9da60
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:57:55 2012 +0100

    xf86/xv: remove scrnIndexfrom xf86FindXvOptions.

    Move this interface to taking an ScrnInfoPtr.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit f80c2374f40ea7b2ee0556e2e76cc07406f3d843
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:53:59 2012 +0100

    xf86: make xf86DeleteScreen take a ScrnInfoPtr (v2)

    stop passing indices into this function.

    v2: drop flags argument.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 58824e414f35682435f15bfe6c4b656bd90b9235
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed May 23 14:48:09 2012 +0100

    xf86: fix xf86IsScreenPrimary interface to take a pScrn (API/ABI)

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 6b4fc1f9d391bcdf7ca288766e49bce60f4635cd
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:18:59 2012 +0100

    xserver: convert block/wakeup handlers to passing ScreenPtr (ABI/API) (v2)

    Instead of passing an index, pass the actual ScreenPtr. This allows
    more moving towards not abusing xf86Screens + screenInfo.

    v2: drop the blockData/wakeupData args as per ajax's suggestion.,
    fix docs.

    Reviewed-by: Keith Packard <keithp@keithp.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 790d003de20fb47674420a24dadd92412d78620d
Author: Dave Airlie <airlied@gmail.com>
Date:   Wed Apr 11 09:53:14 2012 +0100

    xf86/common: remove some more pScrn->pScreen uses

    remove some more conversions that appeared after api cleanups.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aac85e18d1dd093f2cad6bd29375e40bd7af0b8f
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:34:53 2012 +0100

    ddc: change API to take ScrnInfoPtr (v2)

    This removes all xf86Screens usage from ddc code,
    it modifies the API for some functions to avoid taking indices.

    v2: address Alan's comments about dropping DDC2Init parameter.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit fe3f57b6eaf6860a33876a54f9439f69578f03a5
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:31:26 2012 +0100

    vbe: don't use index for VBEInterpretPanelID (API)

    Remove use of xf86screens from vbe module.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit abf1965f4ed91529036d3fdb470d6a3ce6f29675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 16:25:11 2012 +0100

    int10/vbe: don't use xf86Screens. (ABI) (v3)

    Pass the ScrnInfoPtr instead of the index in the int10 struct.

    This saves us using it to dereference xf86Screens.

    v2: address Alan's comment to fix struct alignment.

    v3: squash in all the int10 fixes, test the vm86 code builds,
    after comments by Keith.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 23cca612b4fb5efc33683c7624b803b457387e3d
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:30:18 2012 +0100

    xserver: drop index argument to ScreenInit (ABI/API) (v2)

    This drops the index argument, its the same as pScreen->myNum,
    and its the last major index abuse I can find.

    v2: address Alan's review - update docs, fix xwin/xnest/darwin

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 40d360e2d7e832407f3ed64e3a02c27ecc89a960
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:23:01 2012 +0100

    xf86: migrate PointerMoved from index to ScrnInfoPtr (ABI/API)

    This migrates PointerMoved from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit aa60a2f38679d0eeb979a9c2648c9bc771409bf9
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:20:46 2012 +0100

    xf86: migrate PMEvent to a ScrnInfoPtr (ABI/API)

    This migrates the PMEvent from index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d3f28ef44371ed4a039ffc5dd7eb6408d1269ba2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:18:30 2012 +0100

    xf86: migrate SetDGAMode from index to ScrnInfoPtr (ABI/API)

    This migrates the SetDGAMode callback from an index to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit baf5e4818a74f2b68c3dfdcc56f54322351039a0
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:14:11 2012 +0100

    xf86: migrate ChangeGamma from index to ScrnInfoPtr (ABI/API) (v2)

    This migrates the ChangeGamma interface to avoid passing a index.

    v2: fix xf86RandR12.c + xf86cmap.c call

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 51e5f90ada929d6b23176090badbb42fdb3fa550
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:11:09 2012 +0100

    xf86/exa: migrate index to screen types for EnableDisableFBAccess (ABI/API)

    The EXA interface migrates to ScreenPtr,
    and the xf86 interface migrated to ScrnInfoPtr.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 94f1f21d17e86f96d4a54292a399160950087675
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 15:02:11 2012 +0100

    xf86: migrate ValidMode callback to ScrnInfoPtr (ABI/API)

    This migrates the ValidMode to passing a ScrnInfoPtr instead
    of an index.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 3f8f18198fed4f39ec805b508a3482e91eea26b2
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:59:46 2012 +0100

    xf86: migrate SwitchMode to taking ScrnInfoPtr (ABI/API) (v2)

    This migrate the SwitchMode interface to take a ScrnInfoPtr
    instead of an index.

    v2: drop flags.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit d06a038a5c49328ab3a8d969d24f9fcd22c63202
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:50:37 2012 +0100

    xf86: move AdjustFrame to passing ScrnInfoPtr (ABI/API) (v2)

    This converts AdjustFrame code paths to passing a ScrnInfoPtr
    instead of an integer index.

    v2: drop flags args.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 53d2f8608ffd4090d08e7d5cf2e92fb954959b90
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:41:27 2012 +0100

    xf86: modify FreeScreen callback to take pScrn instead of index. (ABI/API) (v2)

    Another index->pScrn conversion.

    v2: drop flags arg.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 60db37c0b247052e0f5c54b1921fe58a3609c2e3
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:35:41 2012 +0100

    xf86: change EnterVT/LeaveVT to take a ScrnInfoPtr (ABI/API break) (v2)

    This modifies the EnterVT/LeaveVT interfaces to take a ScrnInfoPtr
    instead of an index into xf86Screens. This allows dropping more
    public dereferences of the xf86Screens and screenInfo.

    v2: drop flags args as suggested by Keith, fix docs.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>

commit 06729dbbc804a20242e6499f446acb5d94023c3c
Author: Dave Airlie <airlied@gmail.com>
Date:   Tue Apr 10 14:04:59 2012 +0100

    xserver: remove index from CloseScreen (API/ABI breakage)

    This drops the index from the CloseScreen callback,
    its always been useless really, since the pScreen contains it.

    Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
    Acked-by: Aaron Plattner <aplattner@nvidia.com>
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
2012-06-05 13:22:18 +01:00
Yaakov Selkowitz e501c34d49 hw/xwin/glx: Use silent rules
Signed-off-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-05-04 13:13:57 -05:00
Jeremy Huddleston a818b30598 os: Pass the FatalError message to OsVendorFatalError
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2012-03-24 01:07:05 -07:00
Keith Packard 9838b7032e Introduce a consistent coding style
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>
2012-03-21 13:54:42 -07:00
Colin Harrison 8e78bbb2d2 hw/xwin: Fix spelling of 'Canadian' in winkeybd.h
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-27 11:57:36 +00:00
Colin Harrison 80c073352a hw/xwin: Fix winEnqueueMotion() for change in miPointerSetPosition()
Commit 3b36fd1b49 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-27 11:52:14 +00:00
Colin Harrison ced9db6595 hw/xwin: Ignore WM_DISPLAYCHANGE messages with 0 bpp
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-26 14:45:02 +00:00
Jon TURNEY bea6fb6c7a hw/xwin: Avoid WIN_WINDOW_PROP races during Windows window destruction
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-26 14:40:31 +00:00
Jon TURNEY 9a709d5028 hw/xwin: Handle more motif window decoration hinting
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-26 14:40:30 +00:00
Oliver Schmidt b8b0b841a0 hw/xwin: Fix AltGr key sometimes firing an additional Ctrl-L key
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-26 14:40:28 +00:00
Jon TURNEY 3d3114d55a hw/xwin: Handle the virtual key code generated by the Fn key on IBM Lenovo 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-26 14:40:26 +00:00
Jon TURNEY 74af860f9a hw/xwin: turn on -emulate3buttons if less than 3 mouse buttons are reported
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-26 14:40:25 +00:00
Jon TURNEY c0f3709501 hw/xwin: In multiwindow mode, don't grab native input focus for new windows 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-26 14:40:23 +00:00
Jon TURNEY 25caa8565d hw/xwin: Remove some redundant OS version reporting
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2012-01-26 14:40:20 +00:00
Roland Cassard a9aca218f5 hw/xwin: Don't assume we'll always have converted the clipboard selection 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-26 14:38:52 +00:00
Michel Hummel 75fe336b6c hw/xwin: Mitigate a race condition in clipboard thread initialization
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-26 14:10:48 +00:00
Jon TURNEY 95b1391fe3 hw/xwin: Chain IOError handlers to avoid longjmp across threads
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-26 14:10:24 +00:00
Yaakov Selkowitz 0659437f5e hw/xwin: Improve XWinrc loading and error recovery
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-26 14:10:12 +00:00
Michel Hummel 47c7b6d3e6 hw/xwin: Remove no-longer needed tricks used to prevent the clipboard client 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-26 14:09:35 +00:00
Michel Hummel c1bf3baa44 hw/xwin: Automatically restart clipboard thread
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-26 14:09:02 +00:00
Jon TURNEY ae981341a9 hw/xwin: Give the X window for the clipboard integration client a name
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-26 13:42:06 +00:00
Keith Packard d9eeede52f Revert "dix: Pull client-is-local flag up to the ClientRec"
This reverts commit 49d38b75c8.

ABI change pended for 1.13
2012-01-12 12:09:59 -08:00
Keith Packard e722ad6c3e Merge remote-tracking branch 'jturney/rpavlik-xwin-fixes' 2012-01-09 13:22:28 -08:00
Ryan Pavlik 4e44580efd hw/xwin: Include manifest file in the dist tarball
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-07 22:50:48 +00:00
Ryan Pavlik c763fe51b8 hw/xwin: Fix duplicate definition of HAS_WINSOCK when building for MinGW
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-07 22:50:17 +00:00
Ryan Pavlik 3d80f202b0 hw/xwin: Fix possible null ptr deref in winMWExtWMDecorateWindow()
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-07 22:50:13 +00:00
Ryan Pavlik c824004b45 hw/xwin: Fix possible null ptr deref in winMWExtWMRestackFrame()
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-07 22:50:11 +00:00
Ryan Pavlik 3c501691a0 hw/xwin: Fix possible null ptr deref in winActivateAppPrimaryDD()
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-07 22:50:09 +00:00
Ryan Pavlik a492c02649 hw/xwin: Fix possible null ptr deref in winActivateAppNativeGDI()
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-07 22:50:08 +00:00
Ryan Pavlik b907079596 hw/xwin: Clarify an if statement mixed with ifdef in winSetEngine()
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-07 22:50:06 +00:00
Ryan Pavlik 5c35dd7be7 hw/xwin: Fix rrScreenSetSize function pointer mismatch
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-07 22:50:04 +00:00
Ryan Pavlik aa07d82908 hw/xwin: Remove an empty #if 0/#endif
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-07 22:50:02 +00:00
Ryan Pavlik d459f42e64 hw/xwin: Fix double-free in error path in winQueryRGBBitsAndMasks()
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-07 22:50:01 +00:00
Ryan Pavlik cc7dedd6b5 hw/xwin: Fix a memory leak in error path in winInitWM()
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-07 22:49:51 +00:00
Adam Jackson 49d38b75c8 dix: Pull client-is-local flag up to the ClientRec
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2012-01-06 13:29:53 -05:00
Alan Coopersmith d829a7c5cb Move to autoconf standard function name checks & defines
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-12-05 14:32:45 -08:00
Paulo Zanoni 3d635fe84d Correctly free config file names
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-24 17:47:37 -02:00
Colin Harrison ffe8ec86db hw/xwin: Fix a typo in ddraw.h
Fix a (fortunately benign) typo in ddraw.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2011-11-02 14:10:41 +00:00
Yaakov Selkowitz 48fda3c52b hw/xwin: Revert "Fix bug #5735, Serious flaw in CygwinX clipboard"
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 70ddd0f39d.

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-02 14:08:34 +00:00