Hello community, here is the log from the commit of package libwnck checked in at Wed May 31 02:51:40 CEST 2006. -------- --- GNOME/libwnck/libwnck.changes 2006-05-24 15:42:09.000000000 +0200 +++ libwnck/libwnck.changes 2006-05-30 16:26:35.000000000 +0200 @@ -1,0 +2,7 @@ +Tue May 30 16:25:53 CEST 2006 - danw@suse.de + +- Patch in a new method from libwnck HEAD to allow compiz to know + when a window has a real name (as opposed to a fallback name like + "untitled window"). #173059 + +------------------------------------------------------------------- New: ---- libwnck-has-name.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libwnck.spec ++++++ --- /var/tmp/diff_new_pack.ugZ2Re/_old 2006-05-31 02:50:38.000000000 +0200 +++ /var/tmp/diff_new_pack.ugZ2Re/_new 2006-05-31 02:50:38.000000000 +0200 @@ -17,7 +17,7 @@ Group: Development/Libraries/GNOME Autoreqprov: on Version: 2.12.2 -Release: 29 +Release: 31 Summary: Window Navigator Construction Kit (Library Package) Source: libwnck-%{version}.tar.bz2 Patch: %{name}-uninitialized.patch @@ -32,6 +32,7 @@ Patch9: libwnck-opacity-2.patch Patch10: libwnck-2.12.2-viewport-1.patch Patch11: libwnck-border_width-fix-1.patch +Patch12: libwnck-has-name.patch %description The Window Navigator Construction Kit is a library that can be used to @@ -77,6 +78,7 @@ %patch9 %patch10 %patch11 +%patch12 %build rename no nb po/no.* @@ -123,6 +125,10 @@ rm -rf $RPM_BUILD_ROOT %changelog -n libwnck +* Tue May 30 2006 - danw@suse.de +- Patch in a new method from libwnck HEAD to allow compiz to know + when a window has a real name (as opposed to a fallback name like + "untitled window"). #173059 * Fri May 12 2006 - dreveman@suse.de - Fix so that correct geometry is returned when border width is greater than 0. (bnc 178222) ++++++ libwnck-has-name.patch ++++++ Index: libwnck/window.c ================================================================================ --- libwnck/window.c +++ libwnck/window.c @@ -216,7 +216,7 @@ { window->priv = g_new0 (WnckWindowPrivate, 1); - window->priv->name = g_strdup (FALLBACK_NAME); + window->priv->name = NULL; window->priv->icon_name = NULL; window->priv->workspace = ALL_WORKSPACES; @@ -447,12 +447,35 @@ } /** + * wnck_window_has_name: + * @window: a #WnckWindow + * + * Checks whether or not @window has a name. wnck_window_get_name() + * will always return some value, even if the window hasn't set a + * name; wnck_window_has_name() can be used to tell if that name is + * real or not. + * + * For icons titles, use wnck_window_has_icon_name() instead. + * + * Return value: %TRUE if wnck_window_get_name() returns the window's + * real name, %FALSE if it returns a fallback name. + **/ +gboolean +wnck_window_has_name (WnckWindow *window) +{ + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); + + return window->priv->name != NULL; +} + +/** * wnck_window_get_name: * @window: a #WnckWindow * * Gets the name of the window, as it should be displayed in a pager * or tasklist. Always returns some value, even if the window - * hasn't set a name. + * hasn't set a name; use wnck_window_has_name() if you need to know + * whether the returned name is "real" or not. * * For icons titles, use wnck_window_get_icon_name() instead. * @@ -463,17 +486,47 @@ { g_return_val_if_fail (WNCK_IS_WINDOW (window), NULL); - return window->priv->name; + if (window->priv->name) + return window->priv->name; + else + return FALLBACK_NAME; +} + +/** + * wnck_window_has_icon_name: + * @window: a #WnckWindow + * + * Checks whether or not @window has an icon name. + * wnck_window_get_icon_name() will always return some value, even if + * the window hasn't set an icon name; wnck_window_has_icon_name() can + * be used to tell if that name is real or not. + * + * (Note that if wnck_window_has_icon_name() returns %FALSE, but + * wnck_window_has_name() returns %TRUE, then the name returned by + * wnck_window_get_icon_name() is the window name. Only when both + * methods return %FALSE does wnck_window_get_icon_name() return a + * generic fallback name.) + * + * Return value: %TRUE if wnck_window_get_icon_name() returns the + * window's real icon name, %FALSE if it returns a fallback name. + **/ +gboolean +wnck_window_has_icon_name (WnckWindow *window) +{ + g_return_val_if_fail (WNCK_IS_WINDOW (window), FALSE); + + return window->priv->icon_name != NULL; } /** * wnck_window_get_icon_name: * @window: a #WnckWindow * - * Gets the name of the window, as it should be displayed for an - * icon. Always returns some value, even if the window hasn't set a - * name. Contrast with wnck_window_get_name(), which returns the - * window title, not the icon title. + * Gets the name of the window, as it should be displayed for an icon. + * Always returns some value, even if the window hasn't set a name; + * use wnck_window_has_icon_name() if you need to know if the name is + * "real" or not. Contrast with wnck_window_get_name(), which returns + * the window title, not the icon title. * * Return value: name of the window **/ @@ -484,8 +537,10 @@ if (window->priv->icon_name) return window->priv->icon_name; - else + else if (window->priv->name) return window->priv->name; + else + return FALLBACK_NAME; } WnckApplication* @@ -1950,9 +2005,6 @@ window->priv->need_update_name = FALSE; window->priv->name = _wnck_get_name (window->priv->xwindow); - - if (window->priv->name == NULL) - window->priv->name = g_strdup (FALLBACK_NAME); } static void @@ -2297,32 +2349,43 @@ * and we have to fix that before we emit any other signals */ - old_name = window->priv->name; - window->priv->name = NULL; + if (window->priv->need_update_name) + { + old_name = window->priv->name; + window->priv->name = NULL; - update_name (window); + update_name (window); - if (window->priv->name == NULL) - window->priv->name = old_name; - else - { - if (strcmp (window->priv->name, old_name) != 0) - do_emit_name_changed = TRUE; + if (old_name == NULL || window->priv->name == NULL) + { + if (old_name != window->priv->name) + do_emit_name_changed = TRUE; + } + else + { + if (strcmp (window->priv->name, old_name) != 0) + do_emit_name_changed = TRUE; + } g_free (old_name); } - old_icon_name = window->priv->icon_name; - window->priv->icon_name = NULL; + if (window->priv->need_update_icon_name) + { + old_icon_name = window->priv->icon_name; + window->priv->icon_name = NULL; - update_icon_name (window); + update_icon_name (window); - if (window->priv->icon_name == NULL) - window->priv->icon_name = old_icon_name; - else - { - if (old_icon_name == NULL || - strcmp (window->priv->icon_name, old_icon_name) != 0) - do_emit_name_changed = TRUE; + if (old_icon_name == NULL || window->priv->icon_name == NULL) + { + if (old_icon_name != window->priv->icon_name) + do_emit_name_changed = TRUE; + } + else + { + if (strcmp (window->priv->icon_name, old_icon_name) != 0) + do_emit_name_changed = TRUE; + } g_free (old_icon_name); } --- libwnck/window.h +++ libwnck/window.h @@ -136,7 +136,9 @@ WnckScreen* wnck_window_get_screen (WnckWindow *window); +gboolean wnck_window_has_name (WnckWindow *window); const char* wnck_window_get_name (WnckWindow *window); +gboolean wnck_window_has_icon_name (WnckWindow *window); const char* wnck_window_get_icon_name (WnckWindow *window); WnckApplication* wnck_window_get_application (WnckWindow *window); ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Remember to have fun...
participants (1)
-
root@suse.de