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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
_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>
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>
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>
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>
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>
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>
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>
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>
Make winOverrrideStyle() thread-safe
winOverrideStyle() is called from the internal WM client thread.
Accessing server-internal data structures to get window name and
class 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
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>
Java applications using AWT on JRE 1.6.0 break with non-reparenting WMs AWT
doesn't explicitly know about (See sun bug #6434227)
XDecoratedPeer.handleConfigureNotifyEvent() only processes non-synthetic
ConfigureNotify events to update window location if it's identified the
WM as a non-reparenting WM it knows about (compiz or lookingglass)
Rather than tell all sorts of lies to get XWM to recognize us as one of
those, simply send a synthetic ConfigureNotify for every non-synthetic one
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>
winmultiwindowwm.c: In function ‘winApplyHints’:
winmultiwindowwm.c:1587: warning: ISO C90 forbids mixed declarations and code
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Tidy up some cosmetic issues in log strings:
- Add missing '\n'
- Fix some strings starting with '\n'
- Remove '\f' from some log strings
These all just look daft in a log with timestamps.
Also clarify log message about screen origin coordinates
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Reverts the change which makes parented windows non-resizeable
Because this was trying to do something which we should be doing, as an alternative we
try checking WM_NORMAL_HINTS for windows which shouldn't be resizable
If a window has a maximum size specified, no maximize box
If a window has a fixed size (max size == min size, per EWMH 1.3 Implementation Notes), no resizing frame
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tidying up of other WM detection code when ading SWT/Motif
fix in commit 71519a572f
was rather over-agressive and now allows other WMs to think
they can start when the internal WM is running.
Revert to the behaviour of selecting ButtonPressMask events
as well on the root window, so other WMs will be dissuaded
from starting
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Treat XSupportsLocale() returning false as non-critical to internal client
theads startup, and issue a warning, not an error
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Apply the Windows title wide-character in -multiwindow mode. Windows should now
display correct client X Window titles for locales with wide characters.
Copyright (C) Colin Harrison 2005-2008
http://www.straightrunning.com/XmingNotes/http://sourceforge.net/projects/xming/
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Workaround a bug in iiimxcf (assuming the WM_STATE atom exists),
which can cause many Solaris clients to simply fail with a BadAtom
error
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Don't conditionalize use of an authorization cookie for internal client
threads on XCSECURITY, always use one (this avoids certain problems
with XDMCP setups where the XDMCP host removes localhost from the access
list etc.)
Conditionalize the use of a XCSECURITY authorization descriptor on XCSECURITY
Consolidate the various places where the authorization cookie is set
for internal threads into a new function, winSetAuthorization()
Use authorization cookie for multiwindow WM X message thread as well
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
SWT/Motif expects all top-level windows to get reparented, and waits until they
do. So workaround that in our internal WM by forcing a reparent event to
occur, even though we don't actually need to reparent the window to
frame it (as the frame is a native window, not an X window)
http://sourceware.org/bugzilla/show_bug.cgi?id=9848https://bugs.eclipse.org/bugs/show_bug.cgi?id=36806
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
Tidy up code for detecting another WM is already running
Fix typo g_fAnotherWMRunnig -> g_fAnotherWMRunning
Remove some unused event mask macros
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Reviewed-by: Colin Harrison <colin.harrison@virgin.net>
A few tweaks to winUpdateWindowPosition():
* Don't allow window decoration to disappear off to top or left edge of the
display as a result of adjustments to add decoration for the window style
* Honour the position requested by window geometry for the client area (so
windows which save their position don't get moved by the decoration width
every time they are created) (unless we need to bump it away from top or left edges)
* Fix an issue with initial window placement being offscreen on multimonitor
systems when some monitors have negative coordinates (are to the left of or
above the primary monitor)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
Remove frames from 'dock' windows and make them topmost in -multiwindow mode.
Remove frames from windows with MOTIF_WM_HINTS of no decorations in -multiwindow mode.
Apply some _NET_WM_STATE hints in -multiwindow mode.
Apply window styles overrides from .rc file
Correctly update region of shaped windows when applying styles
Copyright (C) Colin Harrison 2005-2009
http://www.straightrunning.com/XmingNotes/http://sourceforge.net/projects/xming/
Build and link with rootless extension
Update Xwin code for removal of RootlessAccelInit()
Fix Xwin code which now has a collision with the type name EventType
Based on patches from Colin Harrison, Jon Turney and Yaakov Selkowitz
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
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>
Fix the native HWND atom identifier to be initialized correctly, when built without external WM support
This is neccessary for native window naming to work correctly in multiwindow internal WM mode.
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>
The Cygwin/X build has been broken for a long time, probably since modular X
This patch fixes up configure/makefile and some general build issues (#18568)
Signed-off-by: Jon TURNEY <jon.turney@dronecode.org.uk>