Commit Graph

8 Commits

Author SHA1 Message Date
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
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
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
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
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
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
71550a8665 Cygwin/X: Decorate function pointers retrieved via GetProcAddress with WINAPI
Decorate function pointers retrieved via GetProcAddress which are currently
missing it with WINAPI, to ensure stdcall convention is used when calling them.

This fixes a crash currently seen when compiled -O2 and the -screen option uses
a size and monitor number e.g. -screen 0 1280x1000@2

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>
2011-04-27 14:23:09 +01:00
Jon TURNEY
46c5778853 Cygwin/X: Move QueryMonitor() out of windprocarg.c
Move QueryMonitor() out of windprocarg.c into a new file, winmonitors.c,
as we use to use it from other places as well

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>
2011-01-19 14:02:20 +00:00