--- /dev/null
+#! /bin/sh -e
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+case "$1" in
+ -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
+ -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+@DPATCH@
+reverted:
+--- new-ion3-darcs/ioncore/clientwin.c 2007-03-25 20:10:54.000000000 +0100
++++ old-ion3-darcs/ioncore/clientwin.c 2007-03-25 20:10:54.000000000 +0100
+@@ -43,7 +43,6 @@
+ #include "bindmaps.h"
+ #include "return.h"
+ #include "conf.h"
+-#include "group.h"
+
+
+ static void set_clientwin_state(WClientWin *cwin, int state);
+@@ -1071,31 +1070,26 @@
+ /*{{{ ConfigureRequest */
+
+
++void clientwin_handle_configure_request(WClientWin *cwin,
++ XConfigureRequestEvent *ev)
+-static bool check_fs_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev)
+ {
++ if(ev->value_mask&CWBorderWidth)
++ cwin->orig_bw=ev->border_width;
++
++ if(cwin->flags&CLIENTWIN_PROP_IGNORE_CFGRQ){
++ sendconfig_clientwin(cwin);
++ return;
++ }
++
+ /* check full screen request */
+ if((ev->value_mask&(CWWidth|CWHeight))==(CWWidth|CWHeight)){
++ bool sw=clientwin_fullscreen_may_switchto(cwin);
++ if(clientwin_check_fullscreen_request(cwin, ev->width, ev->height, sw))
++ return;
+- WRegion *grp=region_groupleader_of((WRegion*)cwin);
+- WScreen *scr=clientwin_fullscreen_chkrq(cwin, ev->width, ev->height);
+-
+- if(scr!=NULL && REGION_MANAGER(grp)!=(WRegion*)scr){
+- bool sw=clientwin_fullscreen_may_switchto(cwin);
+-
+- cwin->flags|=CLIENTWIN_FS_RQ;
+-
+- if(!region_fullscreen_scr(grp, scr, sw))
+- cwin->flags&=~CLIENTWIN_FS_RQ;
+- }
+-
+- return TRUE;
+ }
+
++ cwin->flags|=CLIENTWIN_NEED_CFGNTFY;
+- return FALSE;
+-}
+-
+
+-static bool check_normal_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev)
+-{
+ if(ev->value_mask&(CWX|CWY|CWWidth|CWHeight)){
+ WRQGeomParams rq=RQGEOMPARAMS_INIT;
+ int gdx=0, gdy=0;
+@@ -1150,25 +1144,6 @@
+ }
+
+ region_rqgeom((WRegion*)cwin, &rq, NULL);
+-
+- return TRUE;
+- }
+-
+- return FALSE;
+-}
+-
+-
+-void clientwin_handle_configure_request(WClientWin *cwin,
+- XConfigureRequestEvent *ev)
+-{
+- if(ev->value_mask&CWBorderWidth)
+- cwin->orig_bw=ev->border_width;
+-
+- cwin->flags|=CLIENTWIN_NEED_CFGNTFY;
+-
+- if(!(cwin->flags&CLIENTWIN_PROP_IGNORE_CFGRQ)){
+- if(!check_fs_cfgrq(cwin, ev))
+- check_normal_cfgrq(cwin, ev);
+ }
+
+ if(cwin->flags&CLIENTWIN_NEED_CFGNTFY){
+reverted:
+--- new-ion3-darcs/ioncore/fullscreen.c 2007-03-25 20:10:54.000000000 +0100
++++ old-ion3-darcs/ioncore/fullscreen.c 2007-03-25 20:10:54.000000000 +0100
+@@ -20,7 +20,7 @@
+ #include "fullscreen.h"
+ #include "mwmhints.h"
+ #include "focus.h"
++#include "group-cw.h"
+-#include "group.h"
+ #include "return.h"
+
+
+@@ -125,7 +125,8 @@
+ }
+
+
++bool clientwin_check_fullscreen_request(WClientWin *cwin, int w, int h,
++ bool sw)
+-WScreen *clientwin_fullscreen_chkrq(WClientWin *cwin, int w, int h)
+ {
+ WScreen *scr;
+ WMwmHints *mwm;
+@@ -134,7 +135,7 @@
+ mwm=xwindow_get_mwmhints(cwin->win);
+ if(mwm==NULL || !(mwm->flags&MWM_HINTS_DECORATIONS) ||
+ mwm->decorations!=0)
++ return FALSE;
+- return NULL;
+
+ FOR_ALL_SCREENS(scr){
+ if(!region_same_rootwin((WRegion*)scr, (WRegion*)cwin))
+@@ -143,11 +144,17 @@
+ * and doesn't set position, so we also don't check position here,
+ * and instead take the first screen with matching size.
+ */
++ if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h){
++ cwin->flags|=CLIENTWIN_FS_RQ;
++ if(!region_fullscreen_scr((WRegion*)cwin, (WScreen*)scr, sw)){
++ cwin->flags&=~CLIENTWIN_FS_RQ;
++ return FALSE;
++ }
++ return TRUE;
++ }
+- if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h)
+- return scr;
+ }
+
++ return FALSE;
+- return NULL;
+ }
+
+
+reverted:
+--- new-ion3-darcs/ioncore/fullscreen.h 2007-03-25 20:10:54.000000000 +0100
++++ old-ion3-darcs/ioncore/fullscreen.h 2007-03-25 20:10:54.000000000 +0100
+@@ -19,7 +19,8 @@
+
+ #define REGION_IS_FULLSCREEN(REG) OBJ_IS(REGION_PARENT(REG), WScreen)
+
++extern bool clientwin_check_fullscreen_request(WClientWin *cwin,
++ int w, int h, bool switchto);
+-extern WScreen *clientwin_fullscreen_chkrq(WClientWin *cwin, int w, int h);
+ extern bool clientwin_fullscreen_may_switchto(WClientWin *cwin);
+
+ extern bool region_fullscreen_scr(WRegion *reg, WScreen *vp, bool switchto);
+reverted:
+--- new-ion3-darcs/ioncore/manage.c 2007-03-25 20:10:54.000000000 +0100
++++ old-ion3-darcs/ioncore/manage.c 2007-03-25 20:10:54.000000000 +0100
+@@ -136,56 +136,15 @@
+ }
+
+
+-static bool try_fullscreen(WClientWin *cwin, WScreen *dflt,
+- const WManageParams *param)
+-{
+- WScreen *fs_scr=NULL;
+- bool fs=FALSE, tmp;
+-
+- /* Check fullscreen mode. (This is intentionally not done
+- * for transients and windows with target winprops.)
+- */
+- if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp)){
+- if(!tmp)
+- return FALSE;
+- fs_scr=dflt;
+- }
+-
+- if(fs_scr==NULL)
+- fs_scr=netwm_check_initial_fullscreen(cwin);
+-
+- if(fs_scr==NULL)
+- fs_scr=clientwin_fullscreen_chkrq(cwin, param->geom.w, param->geom.h);
+-
+- if(fs_scr!=NULL){
+- WPHolder *fs_ph=region_prepare_manage((WRegion*)fs_scr, cwin, param,
+- MANAGE_REDIR_STRICT_NO);
+-
+- if(fs_ph!=NULL){
+- int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
+-
+- cwin->flags|=CLIENTWIN_FS_RQ;
+-
+- fs=pholder_attach(fs_ph, swf, (WRegion*)cwin);
+-
+- if(!fs)
+- cwin->flags&=~CLIENTWIN_FS_RQ;
+-
+- destroy_obj((Obj*)fs_ph);
+- }
+- }
+-
+- return fs;
+-}
+-
+-
+ bool clientwin_do_manage_default(WClientWin *cwin,
+ const WManageParams *param)
+ {
++ WRegion *r=NULL, *r2;
+ WScreen *scr=NULL;
+ WPHolder *ph=NULL;
++ int fs=-1;
++ int swf;
++ bool ok, tmp, uq=FALSE;
+- int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
+- bool ok, uq=FALSE;
+
+ /* Find a suitable screen */
+ scr=clientwin_find_suitable_screen(cwin, param);
+@@ -210,25 +169,44 @@
+ ph=region_prepare_manage((WRegion*)scr, cwin, param,
+ MANAGE_REDIR_PREFER_YES);
+
++ /* Check fullscreen mode. (This is intentionally not done
++ * for transients and windows with target winprops.)
++ */
++ if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp))
++ fs=tmp;
++
++ if(fs<0)
++ fs=netwm_check_initial_fullscreen(cwin, param->switchto);
++
++ if(fs<0){
++ fs=clientwin_check_fullscreen_request(cwin,
++ param->geom.w,
++ param->geom.h,
++ param->switchto);
++ }
++ }
++
++ if(fs>0){
++ /* Full-screen mode succesfull. */
++ if(pholder_target(ph)==(WRegion*)scr){
++ /* Discard useless placeholder. */
+- if(try_fullscreen(cwin, scr, param)){
+- if(pholder_target(ph)!=(WRegion*)region_screen_of((WRegion*)cwin)){
+- WRegion *grp=region_groupleader_of((WRegion*)cwin);
+- if(region_do_set_return(grp, ph))
+- return TRUE;
+- }
+ destroy_obj((Obj*)ph);
+ return TRUE;
+ }
+
++ if(!region_do_set_return((WRegion*)cwin, ph))
++ destroy_obj((Obj*)ph);
++
++ return TRUE;
+ }
++
+-
+ if(ph==NULL)
+ return FALSE;
+
+ /* Not in full-screen mode; use the placeholder to attach. */
+
++ swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
+ ok=pholder_attach(ph, swf, (WRegion*)cwin);
+-
+ destroy_obj((Obj*)ph);
+
+ if(uq && ok)
+reverted:
+--- new-ion3-darcs/ioncore/netwm.c 2007-03-25 20:10:54.000000000 +0100
++++ old-ion3-darcs/ioncore/netwm.c 2007-03-25 20:10:54.000000000 +0100
+@@ -22,7 +22,6 @@
+ #include "focus.h"
+ #include "xwindow.h"
+ #include "extlconv.h"
+-#include "group.h"
+
+
+ /*{{{ Atoms */
+@@ -86,7 +85,7 @@
+ /*{{{ _NET_WM_STATE */
+
+
++int netwm_check_initial_fullscreen(WClientWin *cwin, bool sw)
+-WScreen *netwm_check_initial_fullscreen(WClientWin *cwin)
+ {
+
+ int i, n;
+@@ -97,16 +96,18 @@
+ 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=region_enter_fullscreen((WRegion*)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;
+ }
+
+
+@@ -144,10 +145,9 @@
+ 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(!region_enter_fullscreen((WRegion*)cwin, sw))
+- if(!region_enter_fullscreen(grp, sw))
+ cwin->flags&=~CLIENTWIN_FS_RQ;
+ }else{
+ /* Should not be set.. */
+@@ -156,10 +156,9 @@
+ }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;
++ region_leave_fullscreen((WRegion*)cwin, sw);
+- region_leave_fullscreen(grp, sw);
+ }else{
+ /* Set the flag */
+ cwin->flags|=CLIENTWIN_FS_RQ;
+reverted:
+--- new-ion3-darcs/ioncore/netwm.h 2007-03-25 20:10:54.000000000 +0100
++++ old-ion3-darcs/ioncore/netwm.h 2007-03-25 20:10:54.000000000 +0100
+@@ -14,7 +14,6 @@
+
+ #include "common.h"
+ #include "rootwin.h"
+-#include "screen.h"
+
+ #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
+ #define _NET_WM_STATE_ADD 1 /* add/set property */
+@@ -23,7 +22,7 @@
+ extern void netwm_init();
+ extern void netwm_init_rootwin(WRootWin *rw);
+
++extern int netwm_check_initial_fullscreen(WClientWin *cwin, bool switchto);
+-extern WScreen *netwm_check_initial_fullscreen(WClientWin *cwin);
+ extern void netwm_update_state(WClientWin *cwin);
+ extern void netwm_delete_state(WClientWin *cwin);
+ extern void netwm_set_active(WRegion *reg);