Bugfix for #1949:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 4 Dec 2004 00:12:53 +0000 (00:12 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sat, 4 Dec 2004 00:12:53 +0000 (00:12 +0000)
F11 to switch between render window / main window didn't work anymore in some
window managers (e.g. fluxbox), after fixing it to work in kde.

intern/ghost/intern/GHOST_WindowX11.cpp

index 1239f2e9d0492fc6648089ee8fc50a9fdd8d9ac3..cfdc173907466dbdea5db30d3a6d972588121c7d 100755 (executable)
@@ -390,6 +390,9 @@ setState(
 
 }
 
+#include <iostream>
+using namespace std;
+
        GHOST_TSuccess 
 GHOST_WindowX11::
 setOrder(
@@ -399,13 +402,15 @@ setOrder(
                XWindowAttributes attr;   
                Atom atom;
 
+               /* We use both XRaiseWindow and _NET_ACTIVE_WINDOW, since some
+                  window managers ignore the former (e.g. kwin from kde) and others
+                  don't implement the latter (e.g. fluxbox pre 0.9.9) */
+
+               XRaiseWindow(m_display, m_window);
+
                atom = XInternAtom(m_display, "_NET_ACTIVE_WINDOW", True);
 
-               if(atom == None) {
-                       /* XRaiseWindow might be ignored, only use it if no other choice */
-                       XRaiseWindow(m_display, m_window);
-               }
-               else {
+               if (atom != None) {
                        Window root;
                        XEvent xev;
                        long eventmask;