Re: UPDATE_FVWM_SCREEN macro?
On Thu, Nov 25, 2021 at 10:56:19PM +, Thomas Adam wrote: > On Wed, Nov 24, 2021 at 03:43:47PM +0100, Dominik Vogt wrote: > > Does anybody know why this is a macro and not a function? > > (screen.h) > > Because when I wrote it, it wasn't as complex as it is now. > > See the ta/update-fvwm-screen branch, I've converted it to a function instead. Looks good, okay to apply. Ciao Dominik ^_^ ^_^ -- Dominik Vogt
Re: UPDATE_FVWM_SCREEN macro?
On Wed, Nov 24, 2021 at 03:43:47PM +0100, Dominik Vogt wrote: > Does anybody know why this is a macro and not a function? > (screen.h) Because when I wrote it, it wasn't as complex as it is now. See the ta/update-fvwm-screen branch, I've converted it to a function instead. Kindly, Thomas
UPDATE_FVWM_SCREEN macro?
Does anybody know why this is a macro and not a function? (screen.h) #define UPDATE_FVWM_SCREEN(fw) \ do { \ rectangle g; \ struct monitor *mnew; \ \ get_unshaded_geometry((fw), ); \ mnew = FindScreenOfXY((fw)->g.frame.x, (fw)->g.frame.y); \ /* Avoid unnecessary updates. */ \ if (mnew == (fw)->m) \ break; \ (fw)->m_prev = (fw)->m;\ (fw)->m = mnew;\ (fw)->Desk = mnew->virtual_scr.CurrentDesk;\ EWMH_SetCurrentDesktop((fw)->m); \ desk_add_fw((fw)); \ BroadcastConfig(M_CONFIGURE_WINDOW, (fw)); \ } while(0) The "do { ... } while (0)" was probably written by me. Ciao Dominik ^_^ ^_^ -- Dominik Vogt