On Tue, Dec 29, 2015 at 12:30:54PM +0100, Matthieu Herrb wrote:
> On Mon, Dec 28, 2015 at 02:25:27PM +0100, Alexander Hall wrote:
> > Instead of attacking x11-ssh-askpass, I think this is a better approach.
> > 
> > Thoughts?
> 
> Hi,
> 
> I've looked a bit at the i3 code now. I like this diff better than
> patching ssh-askpass.
> 
> But this diff make it look like i3 is ignoring the wm size hints when
> the obsolete values in the hints are 0. I would at least add the "obsolete"
> word to the DLOG calls to mitigate that.

Yes, I realized that, and I'm not entirely happy about it.

Considering how the test was previously performed, what do you think
about only extending the current test by ignoring the values unless
there is at least a width and a height specified? Sth like this:

    /*
     * Plasma windows set their geometry in WM_SIZE_HINTS.  Note that
     * these fields are obsolete, so ignore unless there is a width and
     * a height specified.
     */
    if ((wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION || 
wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION) &&
        (wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_US_SIZE || 
wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) &&
        wm_size_hints.width != 0 && wm_size_hints.height != 0) {
        DLOG("We are setting geometry according to the obsolete wm_size_hints "
             "x=%d y=%d w=%d h=%d\n",
             wm_size_hints.x, wm_size_hints.y, wm_size_hints.width, 
wm_size_hints.height);
        geom->x = wm_size_hints.x;
        geom->y = wm_size_hints.y;
        geom->width = wm_size_hints.width;
        geom->height = wm_size_hints.height;
    }


/Alexander


> 
> In fact i3 will use the geometry specified by the window for
> the floating ones, whether the position hint flag is set or not
> (except if the flag *and* the obsolete fields are set).
> 
> I would drop using the obsolete fields completely but the comment
> about "Plasma windows" seems to indicate that KDE people decided to
> use them anyways.
> 
> So ok matthieu@
> 
> > 
> > /Alexander
> > 
> > Index: Makefile
> > ===================================================================
> > RCS file: /cvs/ports/x11/i3/Makefile,v
> > retrieving revision 1.100
> > diff -u -p -r1.100 Makefile
> > --- Makefile        21 Dec 2015 09:48:10 -0000      1.100
> > +++ Makefile        28 Dec 2015 13:21:14 -0000
> > @@ -3,7 +3,7 @@
> >  COMMENT =  improved dynamic tiling window manager
> >  
> >  DISTNAME = i3-4.11
> > -REVISION = 1
> > +REVISION = 2
> >  CATEGORIES =       x11
> >  
> >  EXTRACT_SUFX =     .tar.bz2
> > Index: patches/patch-src_manage_c
> > ===================================================================
> > RCS file: /cvs/ports/x11/i3/patches/patch-src_manage_c,v
> > retrieving revision 1.17
> > diff -u -p -r1.17 patch-src_manage_c
> > --- patches/patch-src_manage_c      18 Dec 2015 15:53:09 -0000      1.17
> > +++ patches/patch-src_manage_c      28 Dec 2015 13:21:14 -0000
> > @@ -5,7 +5,7 @@ Suppress no_focus for first window on a 
> >  Fix multiple memory leaks with regular expressions.
> >  
> >  --- src/manage.c.orig      Wed Sep 30 08:55:10 2015
> > -+++ src/manage.c   Fri Dec 18 13:58:58 2015
> > ++++ src/manage.c   Mon Dec 28 14:05:47 2015
> >  @@ -294,6 +294,7 @@ void manage_window(xcb_window_t window, xcb_get_window
> >           if (match != NULL && match->insert_where != M_BELOW) {
> >               DLOG("Removing match %p from container %p\n", match, nc);
> > @@ -14,7 +14,27 @@ Fix multiple memory leaks with regular e
> >           }
> >       }
> >   
> > -@@ -524,13 +525,23 @@ void manage_window(xcb_window_t window, 
> > xcb_get_window
> > +@@ -431,11 +432,16 @@ void manage_window(xcb_window_t window, 
> > xcb_get_window
> > + 
> > +     /* Plasma windows set their geometry in WM_SIZE_HINTS. */
> > +     if ((wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_US_POSITION || 
> > wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_P_POSITION) &&
> > +-        (wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_US_SIZE || 
> > wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE)) {
> > +-        DLOG("We are setting geometry according to wm_size_hints x=%d 
> > y=%d w=%d h=%d\n",
> > +-             wm_size_hints.x, wm_size_hints.y, wm_size_hints.width, 
> > wm_size_hints.height);
> > ++        wm_size_hints.x != 0 && wm_size_hints.y != 0) {
> > ++        DLOG("We are setting geometry according to wm_size_hints x=%d 
> > y=%d\n",
> > ++             wm_size_hints.x, wm_size_hints.y);
> > +         geom->x = wm_size_hints.x;
> > +         geom->y = wm_size_hints.y;
> > ++    }
> > ++    if ((wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_US_SIZE || 
> > wm_size_hints.flags & XCB_ICCCM_SIZE_HINT_P_SIZE) &&
> > ++        wm_size_hints.width != 0 && wm_size_hints.height != 0) {
> > ++        DLOG("We are setting geometry according to wm_size_hints w=%d 
> > h=%d\n",
> > ++             wm_size_hints.width, wm_size_hints.height);
> > +         geom->width = wm_size_hints.width;
> > +         geom->height = wm_size_hints.height;
> > +     }
> > +@@ -524,13 +530,23 @@ void manage_window(xcb_window_t window, 
> > xcb_get_window
> >       /* Send an event about window creation */
> >       ipc_send_window_event("new", nc);
> >   
> 
> -- 
> Matthieu Herrb


Reply via email to