Re: cleaned up WM state patch



On 26 Feb 2001, Havoc Pennington wrote:

> +void
> +gdk_synthesize_window_state (GdkWindow     *window,
> +                             GdkWindowState unset_flags,
> +                             GdkWindowState set_flags)
> +{
> +  GdkEventWindowState temp_event;
> +  GdkWindowState old;
> +  
> +  g_return_if_fail (window != NULL);
> +  
> +  temp_event.window = window;
> +  temp_event.type = GDK_WINDOW_STATE;
> +  temp_event.send_event = FALSE;
> +  
> +  old = ((GdkWindowObject*) temp_event.window)->state;

<sigh> what's wrong with GDK_WINDOW_OBJECT() ?

>  						 gint        width,
>  						 gint        height);
> +
> +#define GDK_WINDOW_IS_MAPPED(window) ((((GdkWindowObject*)window)->state & GDK_WINDOW_STATE_WITHDRAWN) == 0)

especially here, if developers pass in NULL, with GDK_WINDOW_OBJECT()
they will first get a warning about NULL pointer dereference, with your
direct cast they will just crash. usage of the casting macros has been
convention for a very long time, please adjust your code.

> @@ -1585,4 +1753,95 @@
>  
>    return xevent.xproperty.time;
>  }
> +
> +
> +gboolean
> +gdk_wmspec_supported (GdkAtom property)

this should still be gdk_wmspec_supports(), see my reply to owen
in the previous thread on this.

> +/* returns TRUE if we support the given WM spec feature */
> +gboolean      gdk_wmspec_supported     (GdkAtom property);
> +

---
ciaoTJ








[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]