public inbox for cygwin-xfree@sourceware.org
help / color / mirror / Atom feed
From: Jon TURNEY <jon.turney@dronecode.org.uk>
To: cygwin-xfree@cygwin.com
Cc: Jon TURNEY <jon.turney@dronecode.org.uk>
Subject: [PATCH] Cygwin/X: Internal WM workaround for Java AWT bug
Date: Wed, 21 Jul 2010 19:11:00 -0000	[thread overview]
Message-ID: <1279739474-5128-1-git-send-email-jon.turney@dronecode.org.uk> (raw)
In-Reply-To: <4C474580.3090309@dronecode.org.uk>

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>
---
 hw/xwin/winmultiwindowwm.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/hw/xwin/winmultiwindowwm.c b/hw/xwin/winmultiwindowwm.c
index 52921f3..9edde6e 100644
--- a/hw/xwin/winmultiwindowwm.c
+++ b/hw/xwin/winmultiwindowwm.c
@@ -1127,6 +1127,30 @@ winMultiWindowXMsgProc (void *pArg)
                 }
             }
         }
+      else if (event.type == ConfigureNotify)
+        {
+          if (!event.xconfigure.send_event)
+            {
+              /*
+                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
+               */
+              XEvent event_send = event;
+              event_send.xconfigure.send_event = TRUE;
+              event_send.xconfigure.event = event.xconfigure.window;
+              XSendEvent(event.xconfigure.display,
+                         event.xconfigure.window,
+                         True, StructureNotifyMask,
+                         &event_send);
+            }
+        }
       else if (event.type == PropertyNotify
 	       && event.xproperty.atom == atmWmName)
 	{
-- 
1.7.1


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://x.cygwin.com/docs/
FAQ:                   http://x.cygwin.com/docs/faq/


  reply	other threads:[~2010-07-21 19:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-13 21:57 Mouse offset when using java swing based gui applications Jonas Winkler
2010-07-15 13:38 ` Jon TURNEY
2010-07-15 14:41   ` Richard Evans
2010-07-19 15:51     ` Jon TURNEY
2010-07-19 16:28       ` Richard Evans
2010-07-21 19:07         ` Jon TURNEY
2010-07-21 19:11           ` Jon TURNEY [this message]
2010-07-22  8:39           ` Richard Evans

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1279739474-5128-1-git-send-email-jon.turney@dronecode.org.uk \
    --to=jon.turney@dronecode.org.uk \
    --cc=cygwin-xfree@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).