Commit Graph

30 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 9e02e023b0 hw/xwin: xcbify clipboard integration
Convert clipboard integration code from libX11 to xcb

This drops support for COMPOUND_TEXT.  Presumably some ancient
(pre-2000) clients exist which support that, but not UTF8_STRING, but we
don't have an example to test with. (Given the nature of the thing, the
users of those clients probably work in CJK languages)

Supporting COMPOUND_TEXT would also involve writing (or extracting from
Xlib) support for the ISO 2022 encoding.

v2:
Fix the length of text property set by a SelectionRequest

The length of the text property is not neccessarily the same as the
length of the clipboard text before it is d2u converted (specifically,
if that contains any '\r\n' sequences, it will be shorter as they are
now just '\n')
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 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 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 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 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
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
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
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
Tiago Vignatti cbd4d5dbb7 xserver: delete pervasively use of DISPATCH_PROC
Some functions had to be moved around due some missing static definitions.
Another minor clean up like inexistent function declarations and etc were made
also.

Part of this patch was cooked using:
sed -i -e '/static DISPATCH_PROC*.*;/d' `git ls-files`

Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com>
Reviewed-by: Mikhail Gusarov <dottedmag@dottedmag.net>
2010-09-28 16:45:05 +03:00
Colin Harrison de2ae521ab Xming: Use RegisterClassEx() instead of superseded RegisterClass()
RegisterClass is supserseded by RegisterClassEx, so change to using that everywhere

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-07-29 17:05:17 +01:00
Jon TURNEY 19b3e44ce5 Cygwin/X: Fix -Wold-style-definition warnings
Fix old-style definition warnings caused by definitions with empty
parameter lists "()", which should be "(void)" to indicate the function
takes no parameters, rather than unspecified parameters

Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
2009-02-12 12:03:55 +00:00
Alexander Gottwald 508cdb5cb0 Include xwin-config.h if HAVE_XWIN_CONFIG is defined Cleanup X11 includes
handling Warning fixes
2005-07-04 22:10:43 +00:00
Alexander Gottwald d6e8b1affe Bug 777: Merge from CYGWIN branch 2004-06-21 13:19:32 +00:00
Egbert Eich 2fb5886200 Merging XORG-CURRENT into trunk 2004-04-23 19:54:30 +00:00
Egbert Eich dae90c3af9 Importing vendor version xf86-4_4_99_1 on Sun Mar 14 00:26:39 PST 2004 2004-03-14 08:34:49 +00:00
Egbert Eich 867451f1ab Importing vendor version xf86-4_4_0 on Wed Mar 3 04:09:24 PST 2004 2004-03-03 12:12:50 +00:00
Egbert Eich df0313d35b readding XFree86's cvs IDs 2004-02-26 13:36:15 +00:00
Egbert Eich 147aae87fd Importing vendor version xf86-4_3_99_903 on Wed Feb 26 01:21:00 PST 2004 2004-02-26 09:23:53 +00:00
Kaleb Keithley adc7f9a4eb XFree86 4.3.99.16 Bring the tree up to date for the Cygwin folks 2003-11-25 19:29:01 +00:00
Kaleb Keithley 9508a382f8 Initial revision 2003-11-14 16:48:57 +00:00