one more client flag in xfwm

edscott wilson garcia edscott at imp.mx
Mon Sep 29 16:03:18 CEST 2003


On Sat, 2003-09-27 at 15:50, Eduard Roccatello wrote:
> Hi!
> 
> I'm working on "Always On Top" feature for XFWM (for the next release) but 
> i've found a lil problem in the xfwm client flags management.
> the flag of a client win is a unsigned long and it's a 32 bit value.
> 
> in client.h the flags are defined as
> #define CLIENT_FLAG_FOCUS              (1L<<0)
> #define CLIENT_FLAG_ABOVE              (1L<<1)
> [snip]
> #define CLIENT_FLAG_SESSION_MANAGED    (1L<<30)
> #define CLIENT_FLAG_WORKSPACE_SET      (1L<<31)
> 
> This shifts a 1L long 32 times and may we have only 32 flags.
> I need to add a flag for always on top but i can find a nice method to do 
> this without remove any existing flag.
> 
> How can we fix this problem?

Probably have to add "AC_CHECK_SIZEOF(long)" and "AC_CHECK_SIZEOF(long
long)" to configure.ac. This would be required because i386 returns 4
and 8 while other systems 8 and 8. Depending on the result the flag
variable can be defined to either a long or long long, which would
provide for 64 flags.

Thus the macro for the next flag could be

#define CLIENT_FLAG_NEXT      (0x100000000<<32)

The specific number of zeroes in the above line tells the compiler to
type it as whatever is required, be it long or long long.

or maybe
#define BIG_BIT 0x100000000
#define CLIENT_FLAG_NEXT (BIG_BIT<<32)

regards,

Edscott





More information about the Xfce4-dev mailing list