On Sat, Feb 14, 2004 at 09:45:50AM +0100, Andreas Happe wrote:
> Toggling of tabs doesn't seem to work in floatws, they just get painted
> black (or backgroud colour), but the window shape isn't updated, so you
> can still move a frame by click&holding the pseudo-invisible tab.

I'm sure it worked at some point...

> I don't know if I should change genframe to include a DynFun updateShape

mplex_size_changed(Â, FALSE, TRUE) has the wanted effect.


> or overwrite genframe_toggle_tab (more generic but IMHO overdesigned) in
> floatframe (smaller impact). 

Well, it would be better if floatframes collapsed the tab bar instead of
extending the take over the tab bar's are, and to do this, there would
have to be a separate implementation for floatframes.

> so, which is the preferred solution?

I have attached a patch.

-- 
Tuomo
Index: floatws/floatframe.c
===================================================================
--- floatws/floatframe.c        (revision 1290)
+++ floatws/floatframe.c        (working copy)
@@ -62,6 +62,9 @@
 /*}}}*/
                                                  
 
+#define BAR_H(FRAME) \
+    ((FRAME)->genframe.flags&WGENFRAME_TAB_HIDE ? 0 : (FRAME)->genframe.bar_h)
+
 /*{{{ Geometry */
 
 static void floatframe_offsets(WRootWin *rootwin, const WFloatFrame *frame,
@@ -83,7 +86,7 @@
        off->h=bdw.top+bdw.bottom;
 
        if(frame!=NULL){
-               bar_h=frame->genframe.bar_h;
+               bar_h=BAR_H(frame);
        }else if(rootwin!=NULL){
                GrBorderWidths bdwt=GR_BORDER_WIDTHS_INIT;
                GrFontExtents fntet=GR_FONT_EXTENTS_INIT;
@@ -124,9 +127,9 @@
 static void floatframe_border_geom(const WFloatFrame *frame, WRectangle *geom)
 {
        geom->x=0;
-       geom->y=frame->genframe.bar_h;
+       geom->y=BAR_H(frame);
        geom->w=REGION_GEOM(frame).w;
-       geom->h=REGION_GEOM(frame).h-frame->genframe.bar_h;
+       geom->h=REGION_GEOM(frame).h-BAR_H(frame);
 }
 
 
@@ -135,7 +138,7 @@
        geom->x=0;
        geom->y=0;
        geom->w=frame->bar_w;
-       geom->h=frame->genframe.bar_h;
+       geom->h=BAR_H(frame);
 }
 
 
@@ -274,13 +277,18 @@
 static void floatframe_set_shape(WFloatFrame *frame)
 {
        WRectangle gs[2];
-       
+       int n=0;
+    
        if(frame->genframe.brush!=NULL){
-               floatframe_bar_geom(frame, gs+0);
-               floatframe_border_geom(frame, gs+1);
+        if(!(frame->genframe.flags&WGENFRAME_TAB_HIDE)){
+            floatframe_bar_geom(frame, gs+n);
+            n++;
+        }
+               floatframe_border_geom(frame, gs+n);
+        n++;
        
                grbrush_set_window_shape(frame->genframe.brush, WGENFRAME_WIN(frame),
-                                                                TRUE, 2, gs);
+                                                                TRUE, n, gs);
        }
 }
 
Index: ioncore/genframe.c
===================================================================
--- ioncore/genframe.c  (revision 1290)
+++ ioncore/genframe.c  (working copy)
@@ -503,6 +503,7 @@
                return;
        
        genframe->flags^=WGENFRAME_TAB_HIDE;
+    mplex_size_changed(&(genframe->mplex), FALSE, TRUE);
        mplex_fit_managed(&(genframe->mplex));
        XClearWindow(wglobal.dpy, WGENFRAME_WIN(genframe));
        genframe_draw(genframe, TRUE);

Reply via email to