window: Make window->desc a bit clearer
And remove the hack for the "broken GNU libc". It works fine on my system here.
This commit is contained in:
parent
f05983be42
commit
48a36356dd
@ -742,6 +742,17 @@ sync_client_window_mapped (MetaWindow *window)
|
|||||||
meta_error_trap_pop (window->display);
|
meta_error_trap_pop (window->display);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
meta_window_update_desc (MetaWindow *window)
|
||||||
|
{
|
||||||
|
g_clear_pointer (&window->desc, g_free);
|
||||||
|
|
||||||
|
if (window->title)
|
||||||
|
window->desc = g_strdup_printf ("0x%lx (%.10s)", window->xwindow, window->title);
|
||||||
|
else
|
||||||
|
window->desc = g_strdup_printf ("0x%lx", window->xwindow);
|
||||||
|
}
|
||||||
|
|
||||||
MetaWindow *
|
MetaWindow *
|
||||||
_meta_window_shared_new (MetaDisplay *display,
|
_meta_window_shared_new (MetaDisplay *display,
|
||||||
MetaScreen *screen,
|
MetaScreen *screen,
|
||||||
@ -797,7 +808,7 @@ _meta_window_shared_new (MetaDisplay *display,
|
|||||||
|
|
||||||
window->screen = screen;
|
window->screen = screen;
|
||||||
|
|
||||||
window->desc = g_strdup_printf ("0x%lx", window->xwindow);
|
meta_window_update_desc (window);
|
||||||
|
|
||||||
window->override_redirect = attrs->override_redirect;
|
window->override_redirect = attrs->override_redirect;
|
||||||
|
|
||||||
@ -9925,22 +9936,16 @@ void
|
|||||||
meta_window_set_title (MetaWindow *window,
|
meta_window_set_title (MetaWindow *window,
|
||||||
const char *title)
|
const char *title)
|
||||||
{
|
{
|
||||||
char *str;
|
|
||||||
|
|
||||||
g_free (window->title);
|
g_free (window->title);
|
||||||
window->title = g_strdup (title);
|
window->title = g_strdup (title);
|
||||||
|
|
||||||
/* strndup is a hack since GNU libc has broken %.10s */
|
|
||||||
str = g_strndup (window->title, 10);
|
|
||||||
g_free (window->desc);
|
|
||||||
window->desc = g_strdup_printf ("0x%lx (%s)", window->xwindow, str);
|
|
||||||
g_free (str);
|
|
||||||
|
|
||||||
if (window->frame)
|
if (window->frame)
|
||||||
meta_ui_set_frame_title (window->screen->ui,
|
meta_ui_set_frame_title (window->screen->ui,
|
||||||
window->frame->xwindow,
|
window->frame->xwindow,
|
||||||
window->title);
|
window->title);
|
||||||
|
|
||||||
|
meta_window_update_desc (window);
|
||||||
|
|
||||||
g_object_notify (G_OBJECT (window), "title");
|
g_object_notify (G_OBJECT (window), "title");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user