[gnome-applets/wip/segeiger/windowpicker: 5/7] windowpicker: extract window_is_special function
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/segeiger/windowpicker: 5/7] windowpicker: extract window_is_special function
- Date: Fri, 11 Oct 2019 20:56:29 +0000 (UTC)
commit cf211a320e512f596fabf8ae6cbc24e773e91825
Author: Sebastian Geiger <sbastig gmx net>
Date: Tue Oct 8 23:43:56 2019 +0200
windowpicker: extract window_is_special function
windowpicker/src/task-list.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)
---
diff --git a/windowpicker/src/task-list.c b/windowpicker/src/task-list.c
index ae506060b..a70e6b1c0 100644
--- a/windowpicker/src/task-list.c
+++ b/windowpicker/src/task-list.c
@@ -39,6 +39,9 @@ static GSList *task_lists;
static GtkOrientation
get_applet_orientation (WpApplet *applet);
+static gboolean
+window_is_special (WnckWindow *window);
+
static TaskList *
get_task_list_for_monitor (TaskList *task_list,
GdkMonitor *monitor)
@@ -161,12 +164,8 @@ static void type_changed (WnckWindow *window,
gpointer user_data)
{
TaskList *taskList = TASK_LIST (user_data);
- WnckWindowType type = wnck_window_get_window_type (window);
- if (!(type == WNCK_WINDOW_DESKTOP
- || type == WNCK_WINDOW_DOCK
- || type == WNCK_WINDOW_SPLASHSCREEN
- || type == WNCK_WINDOW_MENU))
+ if (!window_is_special (window))
{
create_task_item (taskList, window);
}
@@ -177,15 +176,11 @@ static void on_window_opened (WnckScreen *screen,
TaskList *taskList)
{
g_return_if_fail (taskList != NULL);
- WnckWindowType type = wnck_window_get_window_type (window);
g_signal_connect_object (window, "type-changed", G_CALLBACK (type_changed),
taskList, 0);
- if (type == WNCK_WINDOW_DESKTOP
- || type == WNCK_WINDOW_DOCK
- || type == WNCK_WINDOW_SPLASHSCREEN
- || type == WNCK_WINDOW_MENU)
+ if (window_is_special (window))
{
return;
}
@@ -397,3 +392,14 @@ get_applet_orientation (WpApplet *applet)
return orientation;
}
+
+static gboolean
+window_is_special (WnckWindow *window)
+{
+ WnckWindowType type = wnck_window_get_window_type (window);
+
+ return type == WNCK_WINDOW_DESKTOP
+ || type == WNCK_WINDOW_DOCK
+ || type == WNCK_WINDOW_SPLASHSCREEN
+ || type == WNCK_WINDOW_MENU;
+}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]