[gnome-applets/wip/windowpicker: 2/2] windowpicker: use GdkMonitor
- From: Sebastian Geiger <segeiger src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-applets/wip/windowpicker: 2/2] windowpicker: use GdkMonitor
- Date: Fri, 14 Dec 2018 15:59:05 +0000 (UTC)
commit c00482d6b67cdd140fe7e118e7d03a7ca17cb636
Author: Sebastian Geiger <sbastig gmx net>
Date: Fri Dec 14 16:56:26 2018 +0100
windowpicker: use GdkMonitor
windowpicker/src/task-list.c | 38 ++++++++++++++++++--------------------
windowpicker/src/task-list.h | 6 +++---
2 files changed, 21 insertions(+), 23 deletions(-)
---
diff --git a/windowpicker/src/task-list.c b/windowpicker/src/task-list.c
index ebeeb78b4..6d004ed4f 100644
--- a/windowpicker/src/task-list.c
+++ b/windowpicker/src/task-list.c
@@ -37,10 +37,10 @@ static GSList *task_lists;
static TaskList *
get_task_list_for_monitor (TaskList *task_list,
- gint monitor)
+ GdkMonitor *monitor)
{
GSList *list;
- gint list_monitor;
+ GdkMonitor *list_monitor;
list = task_lists;
@@ -67,19 +67,19 @@ static void on_task_item_closed (
GTK_WIDGET (item));
}
-static gint
+static GdkMonitor *
window_get_monitor (WnckWindow *window)
{
- GdkScreen *gdk_screen;
+ GdkDisplay *gdk_display;
gint x, y, w, h;
- gdk_screen = gdk_screen_get_default ();
+ gdk_display = gdk_display_get_default ();
wnck_window_get_geometry (window, &x, &y, &w, &h);
- return gdk_screen_get_monitor_at_point (gdk_screen,
- x + w / 2,
- y + h / 2);
+ return gdk_display_get_monitor_at_point (gdk_display,
+ x + w / 2,
+ y + h / 2);
}
static void
@@ -87,8 +87,8 @@ on_task_item_monitor_changed_cb (TaskItem *item,
gint old_monitor,
TaskList *current_list)
{
- gint monitor;
- gint list_monitor;
+ GdkMonitor *monitor;
+ GdkMonitor *list_monitor;
TaskList *list;
monitor = task_item_get_monitor (item);
@@ -122,8 +122,8 @@ static void create_task_item (TaskList *taskList,
WnckWindow *window)
{
GtkWidget *item;
- gint list_monitor;
- gint window_monitor;
+ GdkMonitor *list_monitor;
+ GdkMonitor *window_monitor;
guint num;
num = g_slist_length (task_lists);
@@ -223,7 +223,7 @@ on_monitors_changed (gpointer user_data)
{
TaskList *list;
GdkWindow *window;
- gint list_monitor;
+ GdkMonitor *list_monitor;
list = user_data;
window = gtk_widget_get_window (GTK_WIDGET (list));
@@ -232,8 +232,8 @@ on_monitors_changed (gpointer user_data)
on_window_opened,
list);
- list_monitor = gdk_screen_get_monitor_at_window (gdk_screen_get_default (),
- window);
+ list_monitor = gdk_display_get_monitor_at_window (gdk_display_get_default (),
+ window);
if (task_list_get_monitor (list) == list_monitor)
{
@@ -375,15 +375,13 @@ GtkWidget *task_list_new (WpApplet *windowPickerApplet) {
return (GtkWidget *) taskList;
}
-gint
+GdkMonitor *
task_list_get_monitor (TaskList *list)
{
- GdkScreen *gdk_screen;
GdkWindow *gdk_window;
gdk_window = gtk_widget_get_window (GTK_WIDGET (list));
- gdk_screen = gtk_widget_get_screen (GTK_WIDGET (list));
- return gdk_screen_get_monitor_at_window (gdk_screen,
- gdk_window);
+ return gdk_display_get_monitor_at_window (gdk_display_get_default (),
+ gdk_window);
}
diff --git a/windowpicker/src/task-list.h b/windowpicker/src/task-list.h
index 582c89bbf..cb798834d 100644
--- a/windowpicker/src/task-list.h
+++ b/windowpicker/src/task-list.h
@@ -55,9 +55,9 @@ struct _TaskListClass {
GtkBoxClass parent_class;
};
-GType task_list_get_type (void) G_GNUC_CONST;
+GType task_list_get_type (void) G_GNUC_CONST;
-GtkWidget *task_list_new (WpApplet *applet);
-gint task_list_get_monitor (TaskList *list);
+GtkWidget *task_list_new (WpApplet *applet);
+GdkMonitor *task_list_get_monitor (TaskList *list);
#endif /* _TASK_LIST_H_ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]