On Wed, Dec 14, 2005 at 08:11:18AM +0000, Mike Polyakov wrote: > Hi, > > I don't know if this problem was addressed previously, but I couldn't > find information on this anywhere so I'm posting it here. The problem > that I have is the following: > When a window is maximized, its absolute coordinated on the desk, not > coordinates relative to a page, are remembered. So when that window is > later unmaximized, it will snap back to those coordinates relative to > desk, which contains multiple pages. Let's say I maximize a window on > page A and then go to page B and drag the window from page A to the > current page B via the pager. That window is still in maximized state, > so when I unmaximize it, the window snaps back to page A, to the > coordinates that it remembered previously on page A.
Note that the part of the desktop that you can see (the "current page") may be anywhere and may overlap up to four different pages at the same time. That is the reason for the behaviour you see. There is no perfect algorithm to decide where a window should go when it is unmaximized. When i window is maximized, fvwm stores its original geometry and the starting position of the maximized window. When a maximized window is moved, fvwm internally remembers the distance it has travelled. When the window in unmaximized, fvwm puts it in the original location shifted by the number of pages the maximized window was moved. For example, if the window was maximized at page 0 0, then dragged 2.5 pages to the right and exactly one page down, it is unmaximized on page 2 1. This whole algorithm is so complicated because it has to work with windows that are not on the current page at all. The reason for what you see is that you have dragged the window *less than a full page* (maybe just a pixel). > How is it > possible to unset the maximize flag when a window is dragged to a > different page via pager? You won't have much luck doing this from the pager. The pager just moves the windows and has no way to trigger a user defined action after that. > What I would like to achieve is that when a > window is dragged to a current page from another page, and then > maximized, it should fill the whole current page, no matter if it was > maximized or not on the previous page. See below. > When it later is unmaximized, > it should snap back to some coordinates on the current page. This part is relatively easy. Put this into your config file: destroyfunc my_maximize addtofunc my_maximize + I ThisWindow (maximized, currentpage) my_unmaximize $* + I TestRc (nomatch) maximize $* destroyfunc my_unmaximize addtofunc my_unmaximize + I maximize off + I movetopage Then replace all calls of the Maximize command with "my_maximize". This makes sure windows are always unmaximized on the current page (if they overlap the current page when maximized). With that you can define a function to maximize a window on the current page: destroyfunc my_remaximize_on_current_page addtofunc my_remaximize_on_current_page + I my_unmaximize + I my_maximize Now bind this to a key, for example with key f1 tsifw s my_remaximize_on_current_page With that, pressing shift-F1 in a window context maximizes the window on the current page (if it currently overlaps the current page). Ciao Dominik ^_^ ^_^ -- Dominik Vogt, [EMAIL PROTECTED]
signature.asc
Description: Digital signature
