Commit b416f9b3 authored by Alberts Muktupāvels's avatar Alberts Muktupāvels Committed by Marco Trevisan
Browse files

application: use res_class as app name when group is not set

parent ad69fe45
Pipeline #466336 passed with stage
in 1 minute and 7 seconds
......@@ -499,6 +499,7 @@ wnck_application_get_startup_id (WnckApplication *app)
/* xwindow is a group leader */
WnckApplication*
_wnck_application_create (Window xwindow,
gboolean has_group_leader,
WnckScreen *screen)
{
WnckHandle *handle;
......@@ -516,7 +517,8 @@ _wnck_application_create (Window xwindow,
application->priv->xwindow = xwindow;
application->priv->screen = screen;
application->priv->name = _wnck_get_name (xscreen, xwindow);
if (has_group_leader)
application->priv->name = _wnck_get_name (xscreen, xwindow);
if (application->priv->name == NULL)
application->priv->name = _wnck_get_res_class_utf8 (xscreen, xwindow);
......
......@@ -61,6 +61,8 @@ const char* _wnck_window_get_startup_id (WnckWindow *window);
time_t _wnck_window_get_needs_attention_time (WnckWindow *window);
time_t _wnck_window_or_transient_get_needs_attention_time (WnckWindow *window);
gboolean _wnck_window_get_has_group_leader (WnckWindow *window);
WnckWorkspace* _wnck_workspace_create (int number,
WnckScreen *screen);
void _wnck_workspace_destroy (WnckWorkspace *space);
......@@ -82,6 +84,7 @@ void _wnck_application_remove_window (WnckApplication *app,
WnckWindow *window);
WnckApplication* _wnck_application_create (Window xwindow,
gboolean has_group_leader,
WnckScreen *screen);
void _wnck_application_destroy (WnckApplication *app);
void _wnck_application_load_icons (WnckApplication *app);
......
......@@ -1409,7 +1409,11 @@ update_client_list (WnckScreen *screen)
if (app == NULL)
{
app = _wnck_application_create (leader, screen);
gboolean has_group_leader;
has_group_leader = _wnck_window_get_has_group_leader (window);
app = _wnck_application_create (leader, has_group_leader, screen);
created_apps = g_list_prepend (created_apps, app);
}
......
......@@ -72,6 +72,7 @@ struct _WnckWindowPrivate
WnckScreen *screen;
WnckApplication *app;
WnckClassGroup *class_group;
gboolean has_group_leader;
Window group_leader;
Window transient_for;
int orig_event_mask;
......@@ -504,6 +505,7 @@ _wnck_window_create (Window xwindow,
/* Default the group leader to the window itself; it is set in
* update_wmhints() if a different group leader is specified.
*/
window->priv->has_group_leader = FALSE;
window->priv->group_leader = window->priv->xwindow;
window->priv->session_id =
......@@ -767,6 +769,12 @@ wnck_window_get_group_leader (WnckWindow *window)
return window->priv->group_leader;
}
gboolean
_wnck_window_get_has_group_leader (WnckWindow *window)
{
return window->priv->has_group_leader;
}
/**
* wnck_window_get_xid:
* @window: a #WnckWindow.
......@@ -3188,7 +3196,10 @@ update_wmhints (WnckWindow *window)
_wnck_atom_get ("WM_HINTS"));
if (hints->flags & WindowGroupHint)
{
window->priv->group_leader = TRUE;
window->priv->group_leader = hints->window_group;
}
if (hints->flags & XUrgencyHint)
{
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment