diff options
author | Javier <dev.git@javispedro.com> | 2015-01-21 00:43:40 +0100 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2015-01-21 00:43:40 +0100 |
commit | 5dbc254039d1fd79ad587c6c98e9e8428495a0de (patch) | |
tree | f5e66c95acbf4b692960701cfac7c89d75ee3f1c /libmdock/app-id.c | |
parent | 8069ebf9a157ce0952fd9f3ed6a4edcdce071911 (diff) | |
download | mdock-5dbc254039d1fd79ad587c6c98e9e8428495a0de.tar.gz mdock-5dbc254039d1fd79ad587c6c98e9e8428495a0de.zip |
right button menu and other features
Diffstat (limited to 'libmdock/app-id.c')
-rw-r--r-- | libmdock/app-id.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/libmdock/app-id.c b/libmdock/app-id.c index b54ed6c..6ea456a 100644 --- a/libmdock/app-id.c +++ b/libmdock/app-id.c @@ -49,10 +49,15 @@ void app_id_destroy(AppId *appid) g_slice_free(AppId, appid); } +static inline guint str_hash0(const gchar *s) +{ + return s ? g_str_hash(s) : 0; +} + guint app_id_hash(gconstpointer appid_pointer) { const AppId *appid = appid_pointer; - return g_str_hash(appid->host) + appid->uid + g_str_hash(appid->executable) + g_str_hash(appid->wm_class_class) + g_str_hash(appid->wm_class_name); + return str_hash0(appid->host) + appid->uid + str_hash0(appid->executable) + str_hash0(appid->wm_class_class) + str_hash0(appid->wm_class_name); } gboolean app_id_equal(gconstpointer ap, gconstpointer bp) @@ -155,3 +160,12 @@ AppId * app_id_from_window(WnckWindow *window) return appid; } + +gboolean app_id_is_local_user(AppId *appid) +{ + if (appid->host && !is_local_host(appid->host)) { + return FALSE; + } + + return appid->uid == getuid(); +} |