[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 21:24:24 +0000 (UTC)
commit 73b17ef6169b216a4d2ade45864779858c6f79ec
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 | 23 +++++++++++++----------
1 file changed, 13 insertions(+), 10 deletions(-)
---
diff --git a/windowpicker/src/task-list.c b/windowpicker/src/task-list.c
index c1503d4c8..18b70feaf 100644
--- a/windowpicker/src/task-list.c
+++ b/windowpicker/src/task-list.c
@@ -62,6 +62,17 @@ 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;
+}
+
static TaskList *
get_task_list_for_monitor (TaskList *task_list,
GdkMonitor *monitor)
@@ -184,12 +195,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);
}
@@ -200,15 +207,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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]