3 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
7 -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
8 -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
10 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
17 --- new-ion3-darcs/ioncore/clientwin.c 2007-03-25 20:10:54.000000000 +0100
18 +++ old-ion3-darcs/ioncore/clientwin.c 2007-03-25 20:10:54.000000000 +0100
26 static void set_clientwin_state(WClientWin *cwin, int state);
27 @@ -1071,31 +1070,26 @@
28 /*{{{ ConfigureRequest */
31 +void clientwin_handle_configure_request(WClientWin *cwin,
32 + XConfigureRequestEvent *ev)
33 -static bool check_fs_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev)
35 + if(ev->value_mask&CWBorderWidth)
36 + cwin->orig_bw=ev->border_width;
38 + if(cwin->flags&CLIENTWIN_PROP_IGNORE_CFGRQ){
39 + sendconfig_clientwin(cwin);
43 /* check full screen request */
44 if((ev->value_mask&(CWWidth|CWHeight))==(CWWidth|CWHeight)){
45 + bool sw=clientwin_fullscreen_may_switchto(cwin);
46 + if(clientwin_check_fullscreen_request(cwin, ev->width, ev->height, sw))
48 - WRegion *grp=region_groupleader_of((WRegion*)cwin);
49 - WScreen *scr=clientwin_fullscreen_chkrq(cwin, ev->width, ev->height);
51 - if(scr!=NULL && REGION_MANAGER(grp)!=(WRegion*)scr){
52 - bool sw=clientwin_fullscreen_may_switchto(cwin);
54 - cwin->flags|=CLIENTWIN_FS_RQ;
56 - if(!region_fullscreen_scr(grp, scr, sw))
57 - cwin->flags&=~CLIENTWIN_FS_RQ;
63 + cwin->flags|=CLIENTWIN_NEED_CFGNTFY;
68 -static bool check_normal_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev)
70 if(ev->value_mask&(CWX|CWY|CWWidth|CWHeight)){
71 WRQGeomParams rq=RQGEOMPARAMS_INIT;
73 @@ -1150,25 +1144,6 @@
76 region_rqgeom((WRegion*)cwin, &rq, NULL);
85 -void clientwin_handle_configure_request(WClientWin *cwin,
86 - XConfigureRequestEvent *ev)
88 - if(ev->value_mask&CWBorderWidth)
89 - cwin->orig_bw=ev->border_width;
91 - cwin->flags|=CLIENTWIN_NEED_CFGNTFY;
93 - if(!(cwin->flags&CLIENTWIN_PROP_IGNORE_CFGRQ)){
94 - if(!check_fs_cfgrq(cwin, ev))
95 - check_normal_cfgrq(cwin, ev);
98 if(cwin->flags&CLIENTWIN_NEED_CFGNTFY){
100 --- new-ion3-darcs/ioncore/fullscreen.c 2007-03-25 20:10:54.000000000 +0100
101 +++ old-ion3-darcs/ioncore/fullscreen.c 2007-03-25 20:10:54.000000000 +0100
103 #include "fullscreen.h"
104 #include "mwmhints.h"
106 +#include "group-cw.h"
115 +bool clientwin_check_fullscreen_request(WClientWin *cwin, int w, int h,
117 -WScreen *clientwin_fullscreen_chkrq(WClientWin *cwin, int w, int h)
122 mwm=xwindow_get_mwmhints(cwin->win);
123 if(mwm==NULL || !(mwm->flags&MWM_HINTS_DECORATIONS) ||
128 FOR_ALL_SCREENS(scr){
129 if(!region_same_rootwin((WRegion*)scr, (WRegion*)cwin))
130 @@ -143,11 +144,17 @@
131 * and doesn't set position, so we also don't check position here,
132 * and instead take the first screen with matching size.
134 + if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h){
135 + cwin->flags|=CLIENTWIN_FS_RQ;
136 + if(!region_fullscreen_scr((WRegion*)cwin, (WScreen*)scr, sw)){
137 + cwin->flags&=~CLIENTWIN_FS_RQ;
142 - if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h)
152 --- new-ion3-darcs/ioncore/fullscreen.h 2007-03-25 20:10:54.000000000 +0100
153 +++ old-ion3-darcs/ioncore/fullscreen.h 2007-03-25 20:10:54.000000000 +0100
156 #define REGION_IS_FULLSCREEN(REG) OBJ_IS(REGION_PARENT(REG), WScreen)
158 +extern bool clientwin_check_fullscreen_request(WClientWin *cwin,
159 + int w, int h, bool switchto);
160 -extern WScreen *clientwin_fullscreen_chkrq(WClientWin *cwin, int w, int h);
161 extern bool clientwin_fullscreen_may_switchto(WClientWin *cwin);
163 extern bool region_fullscreen_scr(WRegion *reg, WScreen *vp, bool switchto);
165 --- new-ion3-darcs/ioncore/manage.c 2007-03-25 20:10:54.000000000 +0100
166 +++ old-ion3-darcs/ioncore/manage.c 2007-03-25 20:10:54.000000000 +0100
167 @@ -136,56 +136,15 @@
171 -static bool try_fullscreen(WClientWin *cwin, WScreen *dflt,
172 - const WManageParams *param)
174 - WScreen *fs_scr=NULL;
175 - bool fs=FALSE, tmp;
177 - /* Check fullscreen mode. (This is intentionally not done
178 - * for transients and windows with target winprops.)
180 - if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp)){
187 - fs_scr=netwm_check_initial_fullscreen(cwin);
190 - fs_scr=clientwin_fullscreen_chkrq(cwin, param->geom.w, param->geom.h);
193 - WPHolder *fs_ph=region_prepare_manage((WRegion*)fs_scr, cwin, param,
194 - MANAGE_REDIR_STRICT_NO);
197 - int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
199 - cwin->flags|=CLIENTWIN_FS_RQ;
201 - fs=pholder_attach(fs_ph, swf, (WRegion*)cwin);
204 - cwin->flags&=~CLIENTWIN_FS_RQ;
206 - destroy_obj((Obj*)fs_ph);
214 bool clientwin_do_manage_default(WClientWin *cwin,
215 const WManageParams *param)
217 + WRegion *r=NULL, *r2;
222 + bool ok, tmp, uq=FALSE;
223 - int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
226 /* Find a suitable screen */
227 scr=clientwin_find_suitable_screen(cwin, param);
228 @@ -210,25 +169,44 @@
229 ph=region_prepare_manage((WRegion*)scr, cwin, param,
230 MANAGE_REDIR_PREFER_YES);
232 + /* Check fullscreen mode. (This is intentionally not done
233 + * for transients and windows with target winprops.)
235 + if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp))
239 + fs=netwm_check_initial_fullscreen(cwin, param->switchto);
242 + fs=clientwin_check_fullscreen_request(cwin,
250 + /* Full-screen mode succesfull. */
251 + if(pholder_target(ph)==(WRegion*)scr){
252 + /* Discard useless placeholder. */
253 - if(try_fullscreen(cwin, scr, param)){
254 - if(pholder_target(ph)!=(WRegion*)region_screen_of((WRegion*)cwin)){
255 - WRegion *grp=region_groupleader_of((WRegion*)cwin);
256 - if(region_do_set_return(grp, ph))
259 destroy_obj((Obj*)ph);
263 + if(!region_do_set_return((WRegion*)cwin, ph))
264 + destroy_obj((Obj*)ph);
273 /* Not in full-screen mode; use the placeholder to attach. */
275 + swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
276 ok=pholder_attach(ph, swf, (WRegion*)cwin);
278 destroy_obj((Obj*)ph);
282 --- new-ion3-darcs/ioncore/netwm.c 2007-03-25 20:10:54.000000000 +0100
283 +++ old-ion3-darcs/ioncore/netwm.c 2007-03-25 20:10:54.000000000 +0100
287 #include "extlconv.h"
293 /*{{{ _NET_WM_STATE */
296 +int netwm_check_initial_fullscreen(WClientWin *cwin, bool sw)
297 -WScreen *netwm_check_initial_fullscreen(WClientWin *cwin)
302 1, TRUE, (uchar**)&data);
309 + if(data[i]==(long)atom_net_wm_state_fullscreen){
310 + ret=region_enter_fullscreen((WRegion*)cwin, sw);
313 - if(data[i]==(long)atom_net_wm_state_fullscreen)
314 - return region_screen_of((WRegion*)cwin);
325 if(!REGION_IS_FULLSCREEN(cwin)){
326 if(ev->data.l[0]==_NET_WM_STATE_ADD ||
327 ev->data.l[0]==_NET_WM_STATE_TOGGLE){
328 - WRegion *grp=region_groupleader_of((WRegion*)cwin);
329 bool sw=clientwin_fullscreen_may_switchto(cwin);
330 cwin->flags|=CLIENTWIN_FS_RQ;
331 + if(!region_enter_fullscreen((WRegion*)cwin, sw))
332 - if(!region_enter_fullscreen(grp, sw))
333 cwin->flags&=~CLIENTWIN_FS_RQ;
335 /* Should not be set.. */
338 if(ev->data.l[0]==_NET_WM_STATE_REMOVE ||
339 ev->data.l[0]==_NET_WM_STATE_TOGGLE){
340 - WRegion *grp=region_groupleader_of((WRegion*)cwin);
341 bool sw=clientwin_fullscreen_may_switchto(cwin);
342 cwin->flags&=~CLIENTWIN_FS_RQ;
343 + region_leave_fullscreen((WRegion*)cwin, sw);
344 - region_leave_fullscreen(grp, sw);
347 cwin->flags|=CLIENTWIN_FS_RQ;
349 --- new-ion3-darcs/ioncore/netwm.h 2007-03-25 20:10:54.000000000 +0100
350 +++ old-ion3-darcs/ioncore/netwm.h 2007-03-25 20:10:54.000000000 +0100
357 #define _NET_WM_STATE_REMOVE 0 /* remove/unset property */
358 #define _NET_WM_STATE_ADD 1 /* add/set property */
360 extern void netwm_init();
361 extern void netwm_init_rootwin(WRootWin *rw);
363 +extern int netwm_check_initial_fullscreen(WClientWin *cwin, bool switchto);
364 -extern WScreen *netwm_check_initial_fullscreen(WClientWin *cwin);
365 extern void netwm_update_state(WClientWin *cwin);
366 extern void netwm_delete_state(WClientWin *cwin);
367 extern void netwm_set_active(WRegion *reg);