]> git.decadent.org.uk Git - ion3.git/blobdiff - ioncore/netwm.c
Update cfg_kludge_flash for Flash 10
[ion3.git] / ioncore / netwm.c
index cd0cb85b991ac79def8c3bca3df9a512ae2817c4..f85193e910437f8da91e5ce7561df639b7964dce 100644 (file)
@@ -1,12 +1,9 @@
 /*
  * ion/ioncore/netwm.c
  *
- * Copyright (c) Tuomo Valkonen 1999-2006
+ * Copyright (c) Tuomo Valkonen 1999-2009
  *
- * Ion is free software; you can redistribute it and/or modify it under
- * the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or
- * (at your option) any later version.
+ * See the included file LICENSE for details.
  */
 
 #include <X11/Xatom.h>
@@ -22,6 +19,7 @@
 #include "focus.h"
 #include "xwindow.h"
 #include "extlconv.h"
+#include "group.h"
 
 
 /*{{{ Atoms */
@@ -73,8 +71,8 @@ void netwm_init_rootwin(WRootWin *rw)
     XChangeProperty(ioncore_g.dpy, WROOTWIN_ROOT(rw),
                     atom_net_supported, XA_ATOM,
                     32, PropModeReplace, (uchar*)atoms, N_NETWM);
-    /* Something else should probably be used as WM name here. */
-    p[0]=prog_execname();
+
+    p[0]=libtu_progbasename();
     xwindow_set_text_property(rw->dummy_win, atom_net_wm_name, p, 1);
 }
 
@@ -85,7 +83,7 @@ void netwm_init_rootwin(WRootWin *rw)
 /*{{{ _NET_WM_STATE */
 
 
-int netwm_check_initial_fullscreen(WClientWin *cwin, bool sw)
+WScreen *netwm_check_initial_fullscreen(WClientWin *cwin)
 {
 
     int i, n;
@@ -96,18 +94,16 @@ int netwm_check_initial_fullscreen(WClientWin *cwin, bool sw)
                    1, TRUE, (uchar**)&data);
     
     if(n<0)
-        return -1;
+        return NULL;
     
     for(i=0; i<n; i++){
-        if(data[i]==(long)atom_net_wm_state_fullscreen){
-            ret=clientwin_enter_fullscreen(cwin, sw);
-            break;
-        }
+        if(data[i]==(long)atom_net_wm_state_fullscreen)
+            return region_screen_of((WRegion*)cwin);
     }
     
     XFree((void*)data);
 
-    return ret;
+    return NULL;
 }
 
 
@@ -145,9 +141,10 @@ static void netwm_state_change_rq(WClientWin *cwin,
     if(!REGION_IS_FULLSCREEN(cwin)){
         if(ev->data.l[0]==_NET_WM_STATE_ADD || 
            ev->data.l[0]==_NET_WM_STATE_TOGGLE){
+            WRegion *grp=region_groupleader_of((WRegion*)cwin);
             bool sw=clientwin_fullscreen_may_switchto(cwin);
             cwin->flags|=CLIENTWIN_FS_RQ;
-            if(!clientwin_enter_fullscreen(cwin, sw))
+            if(!region_enter_fullscreen(grp, sw))
                 cwin->flags&=~CLIENTWIN_FS_RQ;
         }else{
             /* Should not be set.. */
@@ -156,9 +153,10 @@ static void netwm_state_change_rq(WClientWin *cwin,
     }else{
         if(ev->data.l[0]==_NET_WM_STATE_REMOVE || 
            ev->data.l[0]==_NET_WM_STATE_TOGGLE){
+            WRegion *grp=region_groupleader_of((WRegion*)cwin);
             bool sw=clientwin_fullscreen_may_switchto(cwin);
             cwin->flags&=~CLIENTWIN_FS_RQ;
-            clientwin_leave_fullscreen(cwin, sw);
+            region_leave_fullscreen(grp, sw);
         }else{
             /* Set the flag */
             cwin->flags|=CLIENTWIN_FS_RQ;