Hello!

While I was reading a fvwm's manual page trying to solve some other
problem, I came across StartsOnPageIgnoresTransients style option. 

I had a few lines in my .fvwm2rc that have done exactly the same
function I would expect to get from that style option and that is to put
all transient windows on a current viewport (selected/focused page) no
matter where their parents' windows have been initially placed (there
are some StartsOnPage and SkipMapping styles applied). Since I didn't
want to reinvent the wheel, I have applied it to all program styles
(Style * StartsOnPageIgnoresTransients) and I was surprised that it
actually hasn't changed anything.

I read some code and wrote a trivial fix that is attached, but I believe
that for carrying this completely out, there needs to be decided what is
actually the default placement policy of transient windows. I suppose
that is something that isn't clearly defined in the manual page and that
current behaviour (simply put all transients on page where their parents
are started) is merely result of not (at least properly) honoring
use_start_on_page_for_transient style flag.

Cheers!

-- 
Daniel Vrcic
--- ../fvwm-snap-20100318.ORIG/fvwm/placement.c 2010-03-19 16:04:15.000000000 
+0100
+++ fvwm/placement.c    2010-03-29 20:48:33.000000000 +0200
@@ -1699,8 +1699,15 @@ static int __place_window(
        else if (SUSE_START_ON_DESK(&pstyle->flags) && start_style.desk &&
                 flags.do_honor_starts_on_page)
        {
-               fw->Desk = (start_style.desk > -1) ?
-                       start_style.desk - 1 : start_style.desk;
+               if ( !SUSE_START_ON_PAGE_FOR_TRANSIENT(&pstyle->flags) && 
IS_TRANSIENT(fw) )
+               {
+                       fw->Desk = Scr.CurrentDesk;
+               }
+               else 
+               {
+                       fw->Desk = (start_style.desk > -1) ?
+                               start_style.desk - 1 : start_style.desk;
+               }
                reason->desk.reason = reason->desk.sod_reason;
        }
        else
@@ -1812,7 +1819,9 @@ static int __place_window(
                                MoveViewport(px,py,True);
                                reason->page.do_switch_page = 1;
                        }
-                       else if (flags.do_honor_starts_on_page)
+                       else if (flags.do_honor_starts_on_page && 
+                                       
(SUSE_START_ON_PAGE_FOR_TRANSIENT(&pstyle->flags) 
+                                               || !IS_TRANSIENT(fw) ))
                        {
                                /*  Save the delta from current page */
                                pdeltax = Scr.Vx - px;

Reply via email to