Commit Graph

111 Commits

Author SHA1 Message Date
Jon Turney 4055fed1e7 hw/xwin: Remove XSetAuthorization() for helper clients
All helper client code now uses xcb, so calling XSetAuthorization() is
no longer needed.

This is the last reference to libX11 from helper clients, so linking
with x11-xcb and libX11 is no longer required.

Also drop (unneeded?) linking with libXau.

Also drop installing these prerequistes on AppvVeyor.

Also move prototypes for functions in winauth.c from win.h into a new
header, winauth.h, and include that where needed.
2020-04-15 14:13:58 +00:00
Jon Turney f4936de73c hw/xwin: Remove nounicodeclipboard option
Always use CF_UNICODETEXT clipboard format.  Windows will automatically
down-convert to CF_TEXT for clients which request that.

This is subtly different in one way: if CF_TEXT is requested, we now
post CF_UNICODETEXT and it is converted to CF_TEXT *in the locale of the
requesting process*.  Previously, we would convert to CF_TEXT *in our
locale* and post that.

It looks like the code in the !X_HAVE_UTF8_STRING case didn't actually
work correctly, but fortunately that has never been true...
2020-04-15 14:13:58 +00:00
Jon Turney bcf2dd0cd2 hw/xwin: Add -icon option to set the screen window icon in windowed mode
Add an -icon option to set the screen window icon in windowed mode

Allow cygwin paths in an icon-specification

Update man pages and system.XWinrc appropriately

Also, log an error if the icon specified for TRAYICON cannot be loaded

Also, fix a bug in appending a '\' to IconDirectory only if it doesn't
already end with one, which was fortunately benign.

Note: LoadImageComma would be simpler if we just stated that XWinrc
paths are Cygwin paths on Cygwin, Windows paths on MinGW, but that could
break existing .XWinrc files

Note: Given that we can specify paths in an icon-specifier, I'm not sure
what IconDirectory wins us.

v2:
Fix formatting problems in man page additions

v3:
Fix some more s/_/@/g in man pages
2019-09-18 19:11:45 +00:00
Jon Turney b078e03410 hw/xwin: Make QueryMonitor() slightly less insane
Make QueryMonitor() slightly less insane, making it return TRUE if the
specified monitor exists, rather than always returning TRUE (which we
are uselessly checking, and then also checking if the specified monitor
exists)

(Note that EnumDisplayMonitors() doesn't seem to have meaningful way to
return errors, see 5940580f)

Also: Spamming the long UseMsg() after "Invalid monitor number" isn't very
helpful.

Also: If we are exiting in ddxProcessArgument() due to an error in
options, use a non-zero exit status.
2019-06-28 17:44:58 +00:00
Jon Turney 2afee831a4 hw/xwin: Add an option to use alpha channel in multiwindow mode
Add an option to turn on the use of the X window's alpha channel in
multiwindow mode, i.e. this uses the X window's alpha channel for
compositing into the native desktop.

This works on W7/Vista (using DwmEnableBlurBehindWindow()), and Windows
10 (using the undocumented SetWindowCompositionAttribute()), but not on
Windows 8/8.1

-compositewm must be enabled for this to be useful, as we only have a
pixmap with an alpha channel for the X window in that case.  The
framebuffer/root window doesn't have one (unless perhaps you are using
the rootless extension, maybe...).

v2:
Update meson.build

Future work:

A window property to control use of alpha?
Option to turn off blur on W7/Vista
Implement _NET_WM_WINDOW_OPACITY
2019-06-17 21:56:35 +00:00
Jon Turney ebcea16e71 hw/xwin: A simpleminded attempt at composition
Rather than drawing the window contents from the shadow framebuffer, use
Composite extension redirection to cause the server to maintain a bitmap
image of each top-level X window, and draw the window contents from
that, so that window contents which are occluded in the framebuffer show
correctly in the task bar and task switcher previews.

v2:
Fix incorrect use of memset() found by gcc5

hw/xwin/winshadgdi.c: In function ‘winBltExposedWindowRegionShadowGDI’:
hw/xwin/winshadgdi.c:861:9: warning: ‘memset’ used with constant zero length parameter; this could be due to transposed parameters [-Wmemset-transposed-args]

v3:
Turn on -compositewm by default

v4:
Ignore -swcursor if -compositewm

-swcursor is not compatible with -compositewm (because the window
contents are drawn from an off-screen pixmap, not from the screen
pixmap, where the software cursor will be drawn).

v5:
Update meson.build also
Add -compositewm option to help output
Update CI to install prerequisites
2019-06-17 21:56:35 +00:00
Jon Turney a2302de6fe hw/xwin: Remove mwextwm mode
This has always been described as 'experimental'

We don't think this has any users: This mode has been disabled in Cygwin
packages since March 2016. We've never provided the xwinwm WM for x86_64
Cygwin. No one has even asked where the option has gone.

This leaves XQuartz as the only user of the rootless extension.

Remove --enable-windowswm configure option
Remove multiwindowextwm stuff from Makefiles
Remove -mwextwm option
Remove -mwextwm from man-page and help
Un-ifdef XWIN_MULTIWINDOWEXTWM

v2:
Remove rootless include paths
Remove windowswmproto from meson.build
2019-05-01 14:06:15 +00:00
Alan Coopersmith 4ad21c3247 Add ddxInputThread call from os layer into ddx layer
Allows ddx's to run additional code as necessary to set up the
input thread.

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
2019-02-25 15:48:03 +00:00
Adam Jackson a23eba2a91 dix: Merge AbortDDX into ddxGiveUp
These are so close to identical that most DDXes implement one in terms
of the other. All the relevant cases can be distinguished by the error
code, so merge the functions together to make things simpler.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-09-28 16:25:12 -04:00
Jon Turney 6f9d29040c hw/xwin: Update for glxvnd
- Link with libglxvnd in meson.build
- Call xorgGlxCreateVendor() like all other DDX

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2018-02-19 12:44:04 -05:00
Adam Jackson 67c303fff3 miinitext: Load GLX on the mi path
Add a stub for Xnest so it continues to link, but otherwise we support
GLX on every server so there's no need to make every DDX add it.

Signed-off-by: Adam Jackson <ajax@redhat.com>
2018-02-14 17:04:48 -05:00
Daniel Martin d5379b350f Use ARRAY_SIZE all over the tree
Roundhouse kick replacing the various (sizeof(foo)/sizeof(foo[0])) with
the ARRAY_SIZE macro from dix.h when possible. A semantic patch for
coccinelle has been used first. Additionally, a few macros have been
inlined as they had only one or two users.

Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2017-10-30 13:45:20 -04:00
Emil Velikov 8f1a200d0b xwin: remove always true/set XWIN_MULTIWINDOW conditional/define
v2: drop trailing endif (Jon)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:41 -04:00
Emil Velikov 9d00f6190a xwin: remove always true/set XWIN_CLIPBOARD conditional/define
v2: drop trailing endif (Jon)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:41 -04:00
Jon Turney f5f4d32ac7 Add Windows-DRI extension
If windowsdriproto headers are available, build a Windows-DRI extension,
which supports requests to enable local clients to directly render GL to a
Windows drawable:

- a query to check if WGL is being used on a screen
- a query to map a fbconfigID to a native pixelformatindex
- a query to map a drawable to a native handle

Windows-DRI can only be useful if we are using WGL, so make an note if WGL
is active on a screen.

Make validGlxDrawable() public

Adjust glxWinSetPixelFormat() so it doesn't require a context, just a
screen and config.

That enables factoring out the deferred drawable creation code as
glxWinDeferredCreateDrawable()

Enhance glxWinDeferredCreateDrawable(), so that pixmaps are placed into a
file mapping, so they exist in memory which can be shared with the direct
rendering process.

Currently, this file mapping is accessed by a name generated from the XID.
This will not be unique across multiple server instances. It would perhaps
be better, although more complicated, to use an anonymous file mapping, and
then duplicate the handle for the direct rendering process.

Use glxWinDeferredCreateDrawable() to ensure the native handle exists for
the Windows-DRI query to map a drawable to native handle.

v2:
Various printf format warning fixes

v3:
Fix format warnings on x86
Move some uninteresting windows-dri output to debug log level

v4:
check for windowsdriproto when  --enable-windowsdri
use windowsdriproto_CFLAGS

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-09-15 20:10:29 +01:00
Jon Turney e1b983b55e hw/xwin: Default to -noresize when -fullscreen is used
Currently, just using -fullscreen fails in winValidateArgs(), as the default
-resize=randr is incompatible with -fullscreen.

Set the default resize mode to -noresize if -fullscreen is used.

Also, rename enum value notAllowed -> resizeNotAllowed for clarity.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-06-23 14:15:27 +01:00
Jon Turney 42f7cd5d92 hw/xwin: Tell LogInit() to backup previous logfile as .old
Future work: Do we really need to call LogInit() in so many different
places?

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-06-23 14:15:27 +01:00
Jon Turney 98238ece57 hw/xwin: Ignore the obsolete, undocumented -internalwm option
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:33 +00:00
Jon Turney cdeaebad98 hw/xwin: Remove the long-broken -silent-dup-error option
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:25 +00:00
Jon TURNEY 7a22912edb hw/xwin: Remove Shadow DirectDraw engine
Maybe a long time ago this made some kind of sense, but now there's no good
reason to ever use this, rather than the Shadow DirectDraw NonLocking engine.

Also remove screen private data members used by other removed engines.

Also remove no longer needed OS version check in winDetectSupportedEngines()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23 16:01:55 +00:00
Jon TURNEY 23e07d71b6 hw/xwin: Register native screens with pseudoramiX
Update man page to document pseudo-xinerama

v2: Make the use of PseudoramiXExtensionInit() match the prototype
v3: Update for nonsdk_extinit.h

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-23 15:59:27 +00:00
Jon TURNEY 3aad9b7556 hw/xwin: Turn on -hostintitle by default
Turn on -hostintitle by default
Provide -nohostintitle to disable if needed

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-03-16 16:54:05 +00:00
Keith Packard 6f4c398a0e Merge remote-tracking branch 'jturney/master' 2014-12-08 18:04:08 -08:00
Peter Hutterer 732fd7e571 Drop trailing whitespaces
sed -i "s/[ ]\+$//g" **/*.(c|h)

happy reviewing...
git diff -w is an empty diff.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2014-11-12 10:25:00 +10:00
Jon TURNEY c03f9e23c2 hw/xwin: Add controls for enabling/disabling monitoring of PRIMARY selection
xwinclip: Add -noprimary option
Xwin: Add -primary and -noprimary options and tray-menu control

v2:
Use Bool type for fPrimarySelection
Add -noprimary to usage message
Fix indentation in hw/xwin/winwndproc.c

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-11-09 14:22:35 +00:00
Keith Packard 3a123fbdda Merge remote-tracking branch 'jturney/master'
Conflicts:
	hw/xwin/winpixmap.c

Adam removed a pile of windows code, including this file.
2014-10-27 15:39:26 -07:00
Jon TURNEY 394ad25959 hw/xwin: Fix const warning in winCheckDisplayNumber()
InitOutput.c:1032:19: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2014-10-09 16:33:04 +01:00
Adam Jackson c79f824bf6 xwin: Remove primary DirectDraw engine
Again, as the documentation says, "unsupported, obsolete".

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 09:28:04 +02:00
Adam Jackson 8465ee788f xwin: Remove native GDI engine (v2)
As the man page says, "unsupported, experimental, and barely
functional".  The last even minor updates to any of this were back in
2004, presumably it's not getting better any time soon.

This is also the only GC ops implementation in the tree that actually
falls all the way down to the spans routines for everything, so that's
pretty nice to be rid of.

v2: Fix stray break statement (Jon)

Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2014-10-09 09:27:21 +02: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
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 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 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
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
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
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
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
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
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 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 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 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 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
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 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
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
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 3ead1d810b hw/xwin: Stop pretending we work on NT4
We already link directly to some functions not available in NT4, so stop
pretending we will work on NT4 and link directly to EnumDisplayMonitors()
and SHGetFolderPath()

Also remove mentions of NT4 & Win95 from error messages

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:08:06 +00:00
Jon TURNEY ee19853867 hw/xwin: Link directly to TrackMouseEvent()
TrackMouseEvent has existed in user32 since at least NT4, so
don't bother with jumping through all the ancient compatibility hoops
of finding if _TrackMouseEvent() exists in comctl32 so it can check
if TrackMouseEvent() exists in user32 to see if it needs to emulate
it...

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2011-11-02 14:05:34 +00:00