]> git.decadent.org.uk Git - ion3.git/blob - debian/patches/101_revert-full-screen-changes.diff
Reverted upstream change 'Full screen mode fixes and improvements' which somehow...
[ion3.git] / debian / patches / 101_revert-full-screen-changes.diff
1 #! /bin/sh -e
2 if [ $# -ne 1 ]; then
3     echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
4     exit 1
5 fi
6 case "$1" in
7     -patch) patch -f --no-backup-if-mismatch -p1 < $0;;
8     -unpatch) patch -f --no-backup-if-mismatch -R -p1 < $0;;
9     *)
10         echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
11         exit 1;;
12 esac
13
14 exit 0
15 @DPATCH@                                                                                                                                                       
16 reverted:
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
19 @@ -43,7 +43,6 @@
20  #include "bindmaps.h"
21  #include "return.h"
22  #include "conf.h"
23 -#include "group.h"
24  
25  
26  static void set_clientwin_state(WClientWin *cwin, int state);
27 @@ -1071,31 +1070,26 @@
28  /*{{{ ConfigureRequest */
29  
30  
31 +void clientwin_handle_configure_request(WClientWin *cwin,
32 +                                        XConfigureRequestEvent *ev)
33 -static bool check_fs_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev)
34  {
35 +    if(ev->value_mask&CWBorderWidth)
36 +        cwin->orig_bw=ev->border_width;
37 +    
38 +    if(cwin->flags&CLIENTWIN_PROP_IGNORE_CFGRQ){
39 +        sendconfig_clientwin(cwin);
40 +        return;
41 +    }
42 +
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))
47 +            return;
48 -        WRegion *grp=region_groupleader_of((WRegion*)cwin);
49 -        WScreen *scr=clientwin_fullscreen_chkrq(cwin, ev->width, ev->height);
50 -        
51 -        if(scr!=NULL && REGION_MANAGER(grp)!=(WRegion*)scr){
52 -            bool sw=clientwin_fullscreen_may_switchto(cwin);
53 -            
54 -            cwin->flags|=CLIENTWIN_FS_RQ;
55 -            
56 -            if(!region_fullscreen_scr(grp, scr, sw))
57 -                cwin->flags&=~CLIENTWIN_FS_RQ;
58 -        }
59 -        
60 -        return TRUE;
61      }
62  
63 +    cwin->flags|=CLIENTWIN_NEED_CFGNTFY;
64 -    return FALSE;
65 -}
66 -
67  
68 -static bool check_normal_cfgrq(WClientWin *cwin, XConfigureRequestEvent *ev)
69 -{
70      if(ev->value_mask&(CWX|CWY|CWWidth|CWHeight)){
71          WRQGeomParams rq=RQGEOMPARAMS_INIT;
72          int gdx=0, gdy=0;
73 @@ -1150,25 +1144,6 @@
74          }
75          
76          region_rqgeom((WRegion*)cwin, &rq, NULL);
77 -        
78 -        return TRUE;
79 -    }
80 -    
81 -    return FALSE;
82 -}
83 -
84 -
85 -void clientwin_handle_configure_request(WClientWin *cwin,
86 -                                        XConfigureRequestEvent *ev)
87 -{
88 -    if(ev->value_mask&CWBorderWidth)
89 -        cwin->orig_bw=ev->border_width;
90 -    
91 -    cwin->flags|=CLIENTWIN_NEED_CFGNTFY;
92 -
93 -    if(!(cwin->flags&CLIENTWIN_PROP_IGNORE_CFGRQ)){
94 -        if(!check_fs_cfgrq(cwin, ev))
95 -            check_normal_cfgrq(cwin, ev);
96      }
97  
98      if(cwin->flags&CLIENTWIN_NEED_CFGNTFY){
99 reverted:
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
102 @@ -20,7 +20,7 @@
103  #include "fullscreen.h"
104  #include "mwmhints.h"
105  #include "focus.h"
106 +#include "group-cw.h"
107 -#include "group.h"
108  #include "return.h"
109  
110  
111 @@ -125,7 +125,8 @@
112  }
113  
114  
115 +bool clientwin_check_fullscreen_request(WClientWin *cwin, int w, int h,
116 +                                        bool sw)
117 -WScreen *clientwin_fullscreen_chkrq(WClientWin *cwin, int w, int h)
118  {
119      WScreen *scr;
120      WMwmHints *mwm;
121 @@ -134,7 +135,7 @@
122      mwm=xwindow_get_mwmhints(cwin->win);
123      if(mwm==NULL || !(mwm->flags&MWM_HINTS_DECORATIONS) ||
124         mwm->decorations!=0)
125 +        return FALSE;
126 -        return NULL;
127      
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.
133           */
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;
138 +                return FALSE;
139 +            }
140 +            return TRUE;
141 +        }
142 -        if(REGION_GEOM(scr).w==w && REGION_GEOM(scr).h==h)
143 -            return scr;
144      }
145      
146 +    return FALSE;
147 -    return NULL;
148  }
149  
150  
151 reverted:
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
154 @@ -19,7 +19,8 @@
155  
156  #define REGION_IS_FULLSCREEN(REG) OBJ_IS(REGION_PARENT(REG), WScreen)
157  
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);
162  
163  extern bool region_fullscreen_scr(WRegion *reg, WScreen *vp, bool switchto);
164 reverted:
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 @@
168  }
169  
170  
171 -static bool try_fullscreen(WClientWin *cwin, WScreen *dflt, 
172 -                           const WManageParams *param)
173 -{
174 -    WScreen *fs_scr=NULL;
175 -    bool fs=FALSE, tmp;
176 -    
177 -    /* Check fullscreen mode. (This is intentionally not done
178 -     * for transients and windows with target winprops.)
179 -     */
180 -    if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp)){
181 -        if(!tmp)
182 -            return FALSE;
183 -        fs_scr=dflt;
184 -    }
185 -
186 -    if(fs_scr==NULL)
187 -        fs_scr=netwm_check_initial_fullscreen(cwin);
188 -
189 -    if(fs_scr==NULL)
190 -        fs_scr=clientwin_fullscreen_chkrq(cwin, param->geom.w, param->geom.h);
191 -    
192 -    if(fs_scr!=NULL){
193 -        WPHolder *fs_ph=region_prepare_manage((WRegion*)fs_scr, cwin, param,
194 -                                              MANAGE_REDIR_STRICT_NO);
195 -        
196 -        if(fs_ph!=NULL){
197 -            int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
198 -            
199 -            cwin->flags|=CLIENTWIN_FS_RQ;
200 -            
201 -            fs=pholder_attach(fs_ph, swf, (WRegion*)cwin);
202 -            
203 -            if(!fs)
204 -                cwin->flags&=~CLIENTWIN_FS_RQ;
205 -                
206 -            destroy_obj((Obj*)fs_ph);
207 -        }
208 -    }
209 -
210 -    return fs;
211 -}
212 -
213 -
214  bool clientwin_do_manage_default(WClientWin *cwin, 
215                                   const WManageParams *param)
216  {
217 +    WRegion *r=NULL, *r2;
218      WScreen *scr=NULL;
219      WPHolder *ph=NULL;
220 +    int fs=-1;
221 +    int swf;
222 +    bool ok, tmp, uq=FALSE;
223 -    int swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
224 -    bool ok, uq=FALSE;
225  
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);
231  
232 +        /* Check fullscreen mode. (This is intentionally not done
233 +         * for transients and windows with target winprops.)
234 +         */
235 +        if(extl_table_gets_b(cwin->proptab, "fullscreen", &tmp))
236 +            fs=tmp;
237 +
238 +        if(fs<0)
239 +            fs=netwm_check_initial_fullscreen(cwin, param->switchto);
240 +    
241 +        if(fs<0){
242 +            fs=clientwin_check_fullscreen_request(cwin, 
243 +                                                  param->geom.w,
244 +                                                  param->geom.h,
245 +                                                  param->switchto);
246 +        }
247 +    }
248 +
249 +    if(fs>0){
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))
257 -                    return TRUE;
258 -            }
259              destroy_obj((Obj*)ph);
260              return TRUE;
261          }
262          
263 +        if(!region_do_set_return((WRegion*)cwin, ph))
264 +            destroy_obj((Obj*)ph);
265 +        
266 +        return TRUE;
267      }
268 +        
269 -
270      if(ph==NULL)
271          return FALSE;
272      
273      /* Not in full-screen mode; use the placeholder to attach. */
274      
275 +    swf=(param->switchto ? PHOLDER_ATTACH_SWITCHTO : 0);
276      ok=pholder_attach(ph, swf, (WRegion*)cwin);
277 -    
278      destroy_obj((Obj*)ph);
279      
280      if(uq && ok)
281 reverted:
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
284 @@ -22,7 +22,6 @@
285  #include "focus.h"
286  #include "xwindow.h"
287  #include "extlconv.h"
288 -#include "group.h"
289  
290  
291  /*{{{ Atoms */
292 @@ -86,7 +85,7 @@
293  /*{{{ _NET_WM_STATE */
294  
295  
296 +int netwm_check_initial_fullscreen(WClientWin *cwin, bool sw)
297 -WScreen *netwm_check_initial_fullscreen(WClientWin *cwin)
298  {
299  
300      int i, n;
301 @@ -97,16 +96,18 @@
302                     1, TRUE, (uchar**)&data);
303      
304      if(n<0)
305 +        return -1;
306 -        return NULL;
307      
308      for(i=0; i<n; i++){
309 +        if(data[i]==(long)atom_net_wm_state_fullscreen){
310 +            ret=region_enter_fullscreen((WRegion*)cwin, sw);
311 +            break;
312 +        }
313 -        if(data[i]==(long)atom_net_wm_state_fullscreen)
314 -            return region_screen_of((WRegion*)cwin);
315      }
316      
317      XFree((void*)data);
318  
319 +    return ret;
320 -    return NULL;
321  }
322  
323  
324 @@ -144,10 +145,9 @@
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;
334          }else{
335              /* Should not be set.. */
336 @@ -156,10 +156,9 @@
337      }else{
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);
345          }else{
346              /* Set the flag */
347              cwin->flags|=CLIENTWIN_FS_RQ;
348 reverted:
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
351 @@ -14,7 +14,6 @@
352  
353  #include "common.h"
354  #include "rootwin.h"
355 -#include "screen.h"
356  
357  #define _NET_WM_STATE_REMOVE        0    /* remove/unset property */
358  #define _NET_WM_STATE_ADD           1    /* add/set property */
359 @@ -23,7 +22,7 @@
360  extern void netwm_init();
361  extern void netwm_init_rootwin(WRootWin *rw);
362  
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);