Re: can_change_screen property for GtkWindow



On Tue, 1 Oct 2002, Owen Taylor wrote:

> 
> [ Continuing the "simple bug turns into thousand line patch" saga... ]
> 
> It appears that we need a way to know whether or not it is 
> safe for GTK+ to move a widget between screens.
> 
> Use cases for this:
> 
>  A) For drag-and-drop, GTK+ needs to know whether the icon set using
>     gtk_drag_set_icon_window() can be used across multiple screens.
> 
>  B) We eventually want the ability for window managers to migrate
>     windows across screens, and for users to migrate applications
>     between different displays. GTK+ needs a way to know whether it
>     should advertise support for such capabilities.
> 
> The attached patch adds the GtkWindow API:
> 
>  void     gtk_window_set_can_change_screen         (GtkWindow *window,
> 						   gboolean   can_change_screen);
>  void     gtk_window_unset_can_change_screen       (GtkWindow *window);
>  gboolean gtk_window_get_can_change_screen         (GtkWindow *window);
>  void     gtk_window_set_default_can_change_screen (gboolean   can_change_screen);
>  gboolean gtk_window_get_default_can_change_screen (GtkWindow *window);

these API names frighten me, wouldn't screen_changable be better?

> 
> And properties "can_change_screen" and "can_change_screen_set".

why would you have to know whether the user set the property at all
(i.e. need can_change_screen_set)? if that's an important scenario
different from "user allowed screen changes" and "user forbid screen
changes", then the cleaner aproach is a tri-state property, i.e.
an enumeration. and btw, i assume that you mean:

gtk_window_set_default_can_change_screen (FALSE);
/* window->can_change_screen_set = FALSE; */
prop1 = gtk_window_get_can_change_screen (window);
gtk_window_set_default_can_change_screen (TRUE);
prop2 = gtk_window_get_can_change_screen (window);

to return different values for prop1 and prop2. still, property
change notification for ::can_change_screen will have to be
queued on window in gtk_window_set_default_can_change_screen (TRUE);

> 
> Regards,
>                                         Owen
> 

---
ciaoTJ




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