Commit Graph

894 Commits

Author SHA1 Message Date
Jon Turney
8c0adf404a hw/xwin/glx: Don't create fbConfigs for un-accelerated pixelFormats
Exposing these pixelFormats is problematic: they are provided by the 'GDI
Generic' renderer, which doesn't support the same set of extensions as the
IGD providing the more capable pixelFormats.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-09-25 16:02:10 +01:00
Jon Turney
a9a5bd0020 hw/xwin: Fix 'make distcheck'
Add internal.h to SOURCES, omitted from 126c1cfa

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2018-08-31 08:37:51 +10:00
Jon Turney
08a3583b5b meson: install xwinclip and Xwinrc man pages
Omitted from a1e8dc05

Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2018-05-14 14:13:32 -04:00
Jon Turney
b9764b8489 hw/xwin/glx: Allocate fbconfigs correctly
4b0a3cba fixed leaking of GLX fbconfigs, so now xwin needs to allocate them
correctly (individually, rather than all at once), so they can be freed
successfully.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2018-04-09 17:07:05 -04:00
Adam Jackson
a1e8dc0516 meson: Install man pages
Signed-off-by: Adam Jackson <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
2018-03-27 10:28:33 -04:00
Adam Jackson
2e497bf887 man: s/__/@/g
A cosmetic change for automake (though we have to replicate some of
xorg-macros.m4 in manpages.am now), but meson's configure_file() wants
@-delimited strings.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2018-03-27 10:13:17 -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
Jon Turney
2d29daf4c6 meson.build: Fix hw/xwin build when dependencies are installed in a non-default location
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2018-01-22 13:50:20 -05:00
Jon Turney
3265d0c81f meson: Add dependency on generated code fragments in hw/xwin/glx/
Somehow I'd managed to write this with this dependency missing, so this only
works correctly when the generated files already exist and the correct
automatic dependencies generated, but fails on a clean build.

Including generated files with a .c extension into the sources for a target
causes meson to want to compile them (and it seems to be hard to say "make
the directory containing this generated file available to include").

So, change the extension of included generated C fragments to .ic

Update the autotools build to align.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-12-13 11:32:53 -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
591ac95f73 xwin: automake: remove unused {SRCS, DEFS}_{NATIVEGDI, PRIMARYFB}
Left over from the following commits:

8465ee788f xwin: Remove native GDI engine (v2)
c79f824bf6 xwin: Remove primary DirectDraw engine

v2: drop leading - in the makefile

Cc: Adam Jackson <ajax@redhat.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk> (v1)
2017-08-22 10:59:41 -04:00
Emil Velikov
69fe6156ec xwin: remove always true/set XWIN_RANDR conditional/define
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
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
Emil Velikov
1ef6569225 os: make MitGenerateCookie() independent of XCSECURITY
Analogous to previous commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:40 -04:00
Emil Velikov
292ee71516 os: make GenerateRandomData() independent of XCSECURITY
The function itself does not depend on the macro. Move it outside
of the ifdef guard and remove the identical copy in XWIN.

This is step 1 towards removing the duplication in winauth.c and moving
the OS specifics to os/

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:40 -04:00
Emil Velikov
8aee1f40ea xwin/glx: remove unused __GLXWinScreen::glx_enable_bits
All the relevant code already uses the ::base::glx_enable_bits one.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2017-08-22 10:59:40 -04:00
Adam Jackson
51bab63b73 glx: Remove True/False defines
Those are xlib spellings, we say TRUE/FALSE pretty consistently
elsewhere in the server.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-08-21 10:12:54 -04:00
Adam Jackson
0b1831d043 glx: Remove some indirection around EXT_texture_from_pixmap
Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2017-06-20 16:39:23 -04:00
Jon Turney
1f38a31ed3 Add meson.build for XWin server (v2)
This needs a meson with PRs #1784, #1792 and #1794

Future work: remove conditionals which are always on, and simplify redundant
CYGDEBUG conditionals

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-02 09:32:35 -07:00
Jon Turney
36b9dac212 hw/xwin: Remove pretense of Xv support
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-02 09:32:32 -07:00
Jon Turney
793af4d3f9 hw/xwin: Don't unconditionally include rootless.h
Don't unconditionally include rootless.h, and so we don't need to add
rootless to the include path unless building MWEXTWM.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-06-02 09:32:17 -07:00
Jon Turney
fd96ff7fb3 hw/xwin: Fix -Wunused-function warning for MessageName() in non-debug builds
../hw/xwin/winmultiwindowwm.c:188:1: warning: ‘MessageName’ defined but not used [-Wunused-function]

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:46:37 -04:00
Jon Turney
e49f5947ed hw/xwin: Fix -Wmaybe-uninitialized warnings in engine CloseScreen wrappers
../hw/xwin/winshadgdi.c: In function ‘winCloseScreenShadowGDI’:
../hw/xwin/winshadgdi.c:632:12: warning: ‘fReturn’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winshadgdi.c:579:10: note: ‘fReturn’ was declared here
../hw/xwin/winshadddnl.c: In function ‘winCloseScreenShadowDDNL’:
../hw/xwin/winshadddnl.c:711:12: warning: ‘fReturn’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winshadddnl.c:661:10: note: ‘fReturn’ was declared here

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:46:18 -04:00
Jon Turney
319daa7a9f hw/xwin: Fix -Wmaybe-uninitialized warning in winWindowProc
This is possibly an actual bug in failing to check we successfully retrieved
the monitor size before using it to set the X screen size.

../hw/xwin/winwndproc.c: In function ‘winWindowProc’:
../hw/xwin/winwndproc.c:283:55: warning: ‘dwHeight’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winwndproc.c:240:32: note: ‘dwHeight’ was declared here
../hw/xwin/winwndproc.c:281:54: warning: ‘dwWidth’ may be used uninitialized in this function [-Wmaybe-uninitialized]
../hw/xwin/winwndproc.c:240:23: note: ‘dwWidth’ was declared here

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Yaakov Selkowitz <yselkowitz@users.sourceforge.net>
2017-05-15 17:46:07 -04:00
Adam Jackson
7f1ef9289d dix: Lift DPMS to a screen hook
Following on from the previous change, this adds a DPMS hook to the
ScreenRec and uses that to infer DPMS support. As a result we can drop
the dpms stub code from Xext.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2017-03-27 15:59:42 -04:00
Adam Jackson
8d985c1e69 shadow: Macro cleanup
shadowDamage is just obfuscation. The other two macros won't work
outside shadow.c since the private key is in fact static there (meaning
the extern decl is a lie).

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-12-12 14:10:44 -05:00
Keith Packard
61b159f5a7 hw/xwin: Add 'dri' to DIST_SUBDIRS
This creates the needed Makefile.in files during 'make dist' or 'make
distcheck'

Signed-off-by: Keith Packard <keithp@keithp.com>
2016-09-16 10:57:23 -07: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
Adam Jackson
392da389d7 glx: Fix computation of GLX_X_RENDERABLE fbconfig attribute
>From the GLX spec:

    "GLX_X_RENDERABLE is a boolean indicating whether X can be used to
    render into a drawable created with the GLXFBConfig. This attribute
    is True if the GLXFBConfig supports GLX windows and/or pixmaps."

Every backend was setting this to true unconditionally, and then the
core ignored that value and sent true unconditionally on its own. This
is broken for ARB_fbconfig_float and EXT_fbconfig_packed_float, which
only apply to pbuffers, which are not renderable from non-GLX APIs.

Instead compute GLX_X_RENDERABLE from the supported drawable types. The
dri backends were getting _that_ wrong too, so fix that as well.

This is not a functional change, as there are no mesa drivers that claim
to support __DRI_ATTRIB_{UNSIGNED_,}FLOAT_BIT yet.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
2016-09-06 10:29:14 -04:00
Jon Turney
2a79be9e4d hw/xwin: Update BlockHandler function signature
Update for removal of fdset from Block/Wakeup handler API in 9d15912a

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-07-19 08:10:11 -07:00
Jon Turney
60a91031d1 hw/xwin: Update for removal of AddEnabledDevice
Update for removal of AddEnabledDevice in be5a513f. Use SetNotifyFd instead.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Keith Packard <keithp@keithp.com>
2016-07-19 08:10:03 -07:00
Keith Packard
fb0802113b Remove readmask from screen block/wakeup handler
With no users of the interface needing the readmask anymore, we can
remove it from the argument passed to these functions.

Signed-off-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-07-18 15:27:51 -04:00
Jon Turney
ef1578e736 hw/xwin: Fix a typo in "Remove Shadow DirectDraw engine"
Commit 7a22912e "Remove Shadow DirectDraw engine" contained a typo, changing
the fullscreen && DirectDraw check in WM_DISPLAYCHANGE to fullscreen ||
DirectDraw

This causes disruptive depth changes to be improperly handled

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-06-28 14:29:33 +01:00
Jon Turney
0a0c1bd932 hw/xwin: Fix a crash trying to reload window icons when not in multiwindow mode
ReloadEnumWindowsProc() accesses window privates, which are only valid in
multiwindow mode, but is called in all modes.

Fix this potential crash by not doing this unless in multiwindow mode.

Reproduction steps:
1/ XWin -mwextwm
2/ Run a client which creates an X window e.g. xterm
3/ Right click on notification area icon, and choose 'Reload .XWinrc' from the menu

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-06-28 14:29:30 +01:00
Colin Harrison
91ae257145 hw/xwin: Fix a crash which occurs if focus returns to XWin after xkbcomp has failed
If WM_FOCUS is received while the "core devices failed" fatal error (due to
xkbcomp failing) is displayed, winRestoreModeKeyState() attempts to
dereference a NULL InputInfo.keyboard->key pointer.

Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-06-28 14:29:03 +01:00
Jon Turney
4b123e0f61 hw/xwin: Make window maximizable if a maximium size larger than virtual desktop size is specified
Firefox 38 has a WM_NORMAL_HINTS with a maximum size of 32767x32767.

Don't remove the maximize control from the window frame if the maximum size
is bigger than the virtual desktop size, as maximizing the window will not
exceed the maximium size.

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
504bf495f9 hw/xwin: Detect invalid options in combination with -nodecoration
Detect invalid options in combination with -nodecoration

These are particularly problematic as -nodecoration implies a default of
-nomultimonitors, for some reason, which will gives rendering issues with
-multiwindow.

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
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
1974198382 hw/xwin: Downgrade some uninformative, always-emitted log output to debug
Downgrade from error to debug some uninformative, always-emitted log output
about thread synchronization during initialization

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
17c8bf348e hw/xwin: Check for just the hostname in window title
When -hostintitle is enabled, only use the hostname, not a FQDN from
WM_CLIENT_MACHINE, when checking if the window title already contains it

Also restructure GetWindowName() to fix a potential memory leak.

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
c05c4360ee hw/xwin: Use _NET_WM_NAME for window titles in multiwindow mode
Use _NET_WM_NAME in preference to WM_NAME for window title

Update window title when _NET_WM_NAME property changes

We should always have been doing this, but some qt5 examples only set
_NET_WM_NAME, so now it's become more important...

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
866d8299ab hw/xwin: Remove decorations from _NET_WM_WINDOW_TYPE_SPLASH type windows
In multiwindow mode, remove decorations from _NET_WM_WINDOW_TYPE_SPLASH type
windows.

Some programs use _NET_WM_WINDOW_TYPE_SPLASH_SCREEN in error, so also accept
that as equivalent.

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
356b912906 hw/xwin: Use Bool type in winShowWindowOnTaskbar() prototype
Use the Bool type from X11/Xdefs.h for winShowWindowOnTaskbar().

This is the boolean type we should be using inside the X server, rather than
BOOL, which evaluates to either the Win32 API type, or the Xlib API type,
depending on the context...

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
a6288f0954 hw/xwin: xcbify internal window manager
Convert the code for the multiwindow mode internal window manager to xcb

xcb conversion avoids xlib/xserver namespace collision and _XSERVER64 type
sizing issues

v2: Various fixes
v3: Don't include X11/extensions/windowswmstr.h, which uses the Display type
and thus depends on Xlib.h, just for _WINDOWSWM_NATIVE_HWND
v4: Fix indentation, add some error handling.
Fix a bug with ConfigureNotify handling
v5: Fix a bug which prevented WM_NORMAL_HINTS from being checked

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:31:39 +01:00
Jon Turney
8114b8127f hw/xwin: In multiwindow mode, do window minimization entirely in the WM
Remove winMinimizeWindow(), implement as UpdateState() in the WM instead,
which uses getHwnd() to map a Window XID to a HWND (like everything else in
the WM), rather than peering into the servers internal data structures.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:31:13 +01:00
Jon Turney
6a64b9d7af hw/xwin: xcbify code for converting X11 icon to Win32 icon
Convert the code for converting an X11 icon to Win32 icon from Xlib to xcb.

v2: some warning fixes in winXIconToHICON()
v3: declaration-after-statement warning fixes
v4: printf format fixes
v5: convert in place rather than in a library

This also avoids the xlib/xserver namespace collision issues, so
winmultiwindowicons.h can be included everywhere it should be, which fixes
compilation with -Werror=implicit-function-declaration

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-04-07 10:30:48 +01:00
Jon Turney
0a69c1e2fa xwin/glx: Build fix for warnings about missing WGL extensioons
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-03-30 13:51:19 -04:00
Adam Jackson
2e8781ead3 glx: Compute the GLX extension string from __glXScreenInit
Now that the enable bits are in the screen base class we can compute
this in one place, rather than making every backend do it.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
e21de4bf3c glx: Move glx_enable_bits up to the GLX screen base class
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
36bcbf76dc glx: Enable GLX 1.4 unconditionally
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
2a72789ee8 xwin/glx: Drop GLWIN_NO_WGL_EXTENSIONS hack
This doesn't seem very useful, and we're about to implement 1.4 across
the board, so some WGL extensions will become required.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
77bdaa1313 glx: Use __glXInitExtensionEnableBits in all backends (v2)
On xquartz this enables SGI_make_current_read, which is a mostly
harmless lie as CGL doesn't implement it, as well as SGIX_pbuffer, which
is fine because no pbuffer-enabled configs are created.

On xwin this enables SGIX_pbuffer and ARB_multisample in all cases.
Again this is harmless if the backend doesn't support the features,
since no fbconfigs will be created to expose them.

It also adds SGIX_visual_select_group to both xquartz and xwin.
Amusingly, both were filling in the appropriate field in the fbconfig
already.

v2: Warn about missing WGL extensions (Emil)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 11:13:57 -04:00
Adam Jackson
9b2fc6d986 xwin/glx: Enable GLX_SGI_make_current_read unconditionally (v2)
This seems to be fairly universal these days, and if it doesn't exist
the only thing you break is separate drawable and readable, which is a
rare feature to use. So pretend it's always there and just throw an
error on MakeCurrent if it isn't, and don't consider it when computing
the GLX version number.

v2: Fix type-o for glxWinScreen (Jon Turney)

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:59 -04:00
Adam Jackson
410aec8255 glx: Remove server-side mention of GLX_MESA_swap_control
This extension is direct-only and has no GLX protocol. We don't even
track an enable bit for it, trying to turn it on is pointless.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 10:47:52 -04:00
Adam Jackson
3a21da59e5 glx: Remove default server glx extension string
This existed only to be strdup'd and then immediately freed.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2016-03-30 09:37:41 -04:00
Jon Turney
d11fdff50c hw/xwin: Tidy-up of winmsg.h
- winVMsg() has no uses, so remove
- winMsgVerb() has only one use, with default verbosity, so remove
- winMsg() is identical to LogMessage()
- Put winDrvMsg() and winDrvMsgVerb() under XWIN_XF86CONFIG
- Include what you use Xfuncproto.h for _X_ATTRIBUTE_PRINTF

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:54 +00:00
Jon Turney
519b98765f hw/xwin: Remove GC privates, unused since native GDI engine removal
Unused since native GDI engine removal in commit 8465ee78

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:47 +00:00
Jon Turney
9d28ff2a9b hw/xwin: Use NULL rather than NoopDDA for unimplemented engine functions
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:41 +00:00
Jon Turney
a309085a56 hw/xwin: Remove unused FinishCreateWindowsWindow engine function
This only ever had an (unused) implementation in the DDNL engine, which was
removed in commit 57bbf6e2.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:34 +00:00
Jon Turney
fa6f9d06a3 hw/xwin: Remove unused HotKeyAltTab engine function
This was only ever used by the primaryfb engine, removed in commit c79f824b

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:28 +00:00
Jon Turney
7bd25aa843 hw/xwin: Return FALSE to indicate failure in winSetEngine()
Return FALSE to indicate failure in winSetEngine(), if it couldn't find a
drawing engine to use

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:21 +00:00
Jon Turney
52e05b9282 hw/xwin: Remove WM_WM_MAP message, which is now unused
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:16 +00:00
Jon Turney
c42217aa3d hw/xwin: Remove WM_(UN|)MANAGE messages, which are now never sent
Remove fAnotherWMRunning which tracks this message (although since it was
never initialized, I doubt this worked reliably), and the only use of that,
which was to prevent winMWExtWMRestackWindows() from being used when the
internalwm is running

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:07 +00:00
Jon Turney
b6bdf36842 hw/xwin: Remove allowOtherWM, which is now always FALSE
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:13:01 +00:00
Jon Turney
8407d30962 hw/xwin: Remove winIsInternalWMRunning(), which now always returns FALSE
Also remove then unused variables and IsRaiseonClick()

v2:
Also remove unused pScreenInfo variable in winMWEXtWMRestackFrame()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:51 +00:00
Jon Turney
2779a28a86 hw/xwin: Remove fInternalWM flag
Remove the fInternalWM flag as it is now always FALSE after removing the
-internalwm option

v2:
Also remove then unused pRLWinPriv local from pRLWinPriv()

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-03-09 16:12:40 +00: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
Julien Cristau
d0c1a5bc61 xwin: no need to free auth data if AddResource fails
This is taken care of by SecurityDeleteAuthorization

Reviewed-by: Rémi Cardona <remi@gentoo.org>
Signed-off-by: Julien Cristau <jcristau@debian.org>
2016-03-08 10:20:00 -05:00
Jon Turney
9fecc4cd57 xwin: Remove unhelpful debug about WM message queue size
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
f7d1e5acdf xwin: Add SKIPTASKBAR hint to _NET_WM_WINDOW_TYPE_DOCK type windows
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
e7f87f8f76 xwin: In multiwindow mode, look up the HWND for the parent window
Rather than only looking at the foreground window to see if it matches
the WM_TRANSIENT_FOR window XID, lookup that XID and fetch the HWND from
the window privates.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
856a28f637 xwin: Factor out MessageName() debug helper
Factor out the MessageName() debug helper for message id -> text, and
use it on message queue and dequeue.

Reorder in numerical order to match winwindow.h

Add missing WM_WM_ICON_EVENT

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:33 -05:00
Jon Turney
8c2006ddc5 xwin: Keyboard layout updates
layout zh_TW doesn't exist (anymore), try something else for that.

layout it variant mac doesn't seem to exist anymore, try to handle
Macintosh keyboards (running under Parallels on Mac) and other oddities
in a more generic way, by falling back to matching only on the language
identifer part of the input locale identifer.

v2:
Fix typo of 0xa0000 for 0xa000

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:05:30 -05:00
Colin Harrison
8c97a0078e xwin: Add a tentative entry for the Korean keyboard to the list of known keyboard layouts
Signed-off-by: Colin Harrison <colin.harrison@virgin.net>
Reviewed-by: Jon Turney <jon.turney@dronecode.org.uk>
2016-02-29 14:04:54 -05:00
Jon Turney
a4d8a64c4b xwin: Update to XRANDR 1.2 internal interface to ensure an output is reported by XRANDR
If using the X server internal XRANDR 1.0 interface, it seems we must
register a display size with RRRegisterSize() in order to make
RRGetInfo() call RRScanOldConfig() to generate an output and crtc for
us.

Without this, the following GDM bug means that an XDMCP session to GDM
cannot be started.

https://bugzilla.gnome.org/show_bug.cgi?id=736054

Instead, use the more recent XRANDR 1.2 internal interface to explicitly
create the output and crtc, and maintain a single mode which represents
the current display size.

Also don't emit a RRScreenSizeNotify when a RRScreenSizeSize is done
which has no effect, this seems to throw the GDM greeter into a loop...

v2: Maintain reference count for the mode we maintain more correctly, to
avoid double free causing a crash on shutdown

Connect crtc to output, so a subsequent RRSetCrtcConfig request doesn't
change anything, so we don't fail due to our lack of rrSetConfig or
rrCrtcSet hooks.

See https://cygwin.com/ml/cygwin-xfree/2015-02/msg00032.html

v3:
Raise limit on X display size from 4Kx4K to 32Kx32K

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:36 -05:00
Jon Turney
008efebda8 xwin: Use WM_CLIPBOARDUPDATE clipboard API
Windows Vista and later have a saner clipboard API where the clipboard
viewer linked list is no longer maintained by applications.  Use it
where available.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:31 -05:00
Jon Turney
de7f1fd6f8 xwin: Check that window position is visible on non-rectangular virtual desktops
Improve the check that window position is visible to work correctly for
non-rectangular virtual desktops

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:24 -05:00
Jon Turney
a9e73131b6 xwin: Correctly interpret WM_HINTS, WM_NORMAL_HINTS properties on x86_64
Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:19 -05:00
Jon Turney
d7cef6fbe2 xwin: Improve handling of no-decoration motif hint
When motif decoration hint asks for no decoration, don't add sysmenu,
mimimize or maximimize controls.

(This fixes a problem with e.g. fbpanel having a minimize control, but
gtk's panel_configure_event() doesn't like the state we put the window
into when we minimize it, causing it to spin)

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:12 -05:00
Jon Turney
f75404be3a xwin: XGetWMNormalHints() returns non-zero on success
XGetWMNormalHints() doesn't actually return a Status value.  On success
it returns a non-zero value, not Success.

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:04:06 -05:00
Jon Turney
9dc32746f2 xwin: Fix format warnings when ./configured --enable-debug --enable-windowswm
Fix format warnings (mainly pointer format fixes) which show up when
./configured --enable-debug --enable-windowswm

Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2016-02-29 14:03:42 -05:00
Daniel Stone
e957a2e5dd dix: Add hybrid full-size/empty-clip mode to SetRootClip
216bdbc735 removed the SetRootClip call in the XWayland output-hotplug
handler when running rootless (e.g. as a part of Weston/Mutter), since
the root window has no storage, so generating exposures will result in
writes to invalid memory.

Unfortunately, preventing the segfault also breaks sprite confinement.
SetRootClip updates winSize and borderSize for the root window, which
when combined with RRScreenSizeChanged calling ScreenRestructured,
generates a new sprite-confinment area to update it to the whole screen.

Removing this call results in the window geometry being reported
correctly, but winSize/borderSize never changing from their values at
startup, i.e. out of sync with the root window geometry / screen
information in the connection info / XRandR.

This patch introduces a hybrid mode, where we update winSize and
borderSize for the root window, enabling sprite confinement to work
correctly, but keep the clip emptied so exposures are never generated.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Tested-by: Olivier Fourdan <ofourdan@redhat.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
2016-02-22 13:26:31 -05:00
Adam Jackson
cbd3cfbad3 dix: Restore PaintWindow screen hook
Removes the last cpp conditional on ROOTLESS from dix code.

Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
2015-07-08 16:41:28 -04:00
Jon TURNEY
0cd228073a hw/xwin: printf format fixes for Pixel type
Pixel is CARD32, so inside the server has type unsigned int (x86_64) or unsigned
long (x86)

Cast to unsigned int and use a %u format

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:53 +01:00
Jon TURNEY
e3cfeb949a hw/xwin: printf format fixes for WPARAM and LPARAM types
Some Win32 API types are different fundamental types in the 32-bit and 64-bit

This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.

This makes it impossible to write printf format specifiers which are correct for
all those targets, so we use some macros to provide the correct specifier for
the target.

LPARAM and WPARAM are integer types which can contain a pointer

LPARAM is long in ILP32 and long long in LLP64
WPARAM is unsigned int in ILP32 and unsigned long long in LLP64

Generally, these are just used to passs integer parameters, so for simplicity,
cast to int and use an int-compatible format

In the specific case of WM_CHANGECBCHAIN, they are used to pass HWND, so cast to
that type and print using an appropriate format.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:50 +01:00
Jon TURNEY
4f8661fac9 hw/xwin: printf format fixes for LONG type
Some Win32 API types are different fundamental types in the 32-bit and 64-bit
versions.

This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.

This makes it impossible to write printf format specifiers which are correct for
all those targets

In the Win32 API, DWORD is an signed, 32-bit type.  It is defined in terms of a
long, except in the LP64 data model, where it is an int.

It should always be safe to cast it to int and use %d.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:47 +01:00
Jon TURNEY
aa83c61f51 hw/xwin: printf format fixes for DWORD type
Some Win32 API types are different fundamental types in the 32-bit and 64-bit
versions.

This problem is then further compounded by the fact that whilst both 32-bit
Cygwin and 32-bit MinGW use the ILP32 data model, 64-bit MinGW uses the LLP64
data model, but 64-bit Cygwin uses the LP64 data model.

This makes it impossible to write printf format specifiers which are correct for
all those targets

In the Win32 API, DWORD is an unsigned, 32-bit type.  It is defined in terms of
an unsigned long, except in the LP64 data model, where it is an unsigned int.

It should always be safe to cast it to unsigned int and use %u or %x.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:44 +01:00
Jon TURNEY
487f2595c9 hw/xwin: printf format fixes in xevents.c
Window and Atom types derive from XID, which is always unsigned long in client
code, so use %ld format specifier

XTextProperty.nitems is of type unsigned long, so use %lu format specifier

ulReturnBytesLeft is of type unsigned long, so use %lu format specifier

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:41 +01:00
Jon TURNEY
98798fcf0d hw/xwin: printf format fix in winProcessXEventsTimeout()
remainingTime is computed as a long int, so use %ld format specifier

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:38 +01:00
Jon TURNEY
5b6f511c2f hw/xwin: printf format fix in winCreateDefColormap()
Use %lu for unsigned long

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:35 +01:00
Jon TURNEY
eb67967156 hw/xwin: printf format fixes in winAllocatePrivates()
serverGeneration is of type unsigned long, so use %lu format specifier

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:32 +01:00
Jon TURNEY
0d6c499b99 hw/xwin: printf format fixes in winConfigKeyboard()
struct winInfoRec.keyboard members are of type long, not type int

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:29 +01:00
Jon TURNEY
ba468e003e hw/xwin: printf format fixes for XID type
XID inside the server has type unsigned int (x86_64) or unsigned long (x86)

Follow the example of the rest of the server and cast to unsigned int and use
a %u or %x format.

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:26 +01:00
Jon TURNEY
dcb797b31f hw/xwin: printf format fixes for HWND type
HWND derives from HANDLE, a pointer type, so we should use the %p format

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:23 +01:00
Jon TURNEY
f1d1426667 hw/xwin: Ensure format warnings in winclipboard/
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:20 +01:00
Jon TURNEY
38f340b13e hw/xwin: Remove GetTickCount() from various pieces of debugging output
The use of %d format for the DWORD return value of GetTickCount() isn't
portable, but it doesn't seem to be worth fixing it when this information isn't
very useful (and is redundant to the timestamping of log messages we now have)

Instead just remove these uses of GetTickCount()

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
2015-07-07 16:52:18 +01:00