[gedit] Use the new gdk cursor api
- From: Paolo Borelli <pborelli src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Use the new gdk cursor api
- Date: Wed, 29 Jul 2015 10:32:44 +0000 (UTC)
commit 8ed0f54f95248b4d1dd16abc81dd82f006922ec0
Author: Paolo Borelli <pborelli gnome org>
Date: Wed Jul 29 12:30:15 2015 +0200
Use the new gdk cursor api
gedit/gedit-tab.c | 11 +++++------
plugins/filebrowser/gedit-file-browser-view.c | 11 ++++++-----
plugins/filebrowser/gedit-file-browser-widget.c | 4 ++--
3 files changed, 13 insertions(+), 13 deletions(-)
---
diff --git a/gedit/gedit-tab.c b/gedit/gedit-tab.c
index fd3e408..c776def 100644
--- a/gedit/gedit-tab.c
+++ b/gedit/gedit-tab.c
@@ -449,10 +449,13 @@ static void
set_cursor_according_to_state (GtkTextView *view,
GeditTabState state)
{
+ GdkDisplay *display;
GdkCursor *cursor;
GdkWindow *text_window;
GdkWindow *left_window;
+ display = gtk_widget_get_display (GTK_WIDGET (view));
+
text_window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_TEXT);
left_window = gtk_text_view_get_window (view, GTK_TEXT_WINDOW_LEFT);
@@ -462,9 +465,7 @@ set_cursor_according_to_state (GtkTextView *view,
(state == GEDIT_TAB_STATE_PRINTING) ||
(state == GEDIT_TAB_STATE_CLOSING))
{
- cursor = gdk_cursor_new_for_display (
- gtk_widget_get_display (GTK_WIDGET (view)),
- GDK_WATCH);
+ cursor = gdk_cursor_new_from_name (display, "progress");
if (text_window != NULL)
gdk_window_set_cursor (text_window, cursor);
@@ -475,9 +476,7 @@ set_cursor_according_to_state (GtkTextView *view,
}
else
{
- cursor = gdk_cursor_new_for_display (
- gtk_widget_get_display (GTK_WIDGET (view)),
- GDK_XTERM);
+ cursor = gdk_cursor_new_from_name (display, "text");
if (text_window != NULL)
gdk_window_set_cursor (text_window, cursor);
diff --git a/plugins/filebrowser/gedit-file-browser-view.c b/plugins/filebrowser/gedit-file-browser-view.c
index 9e3d188..7a4ebed 100644
--- a/plugins/filebrowser/gedit-file-browser-view.c
+++ b/plugins/filebrowser/gedit-file-browser-view.c
@@ -301,18 +301,19 @@ static void
set_click_policy_property (GeditFileBrowserView *obj,
GeditFileBrowserViewClickPolicy click_policy)
{
- GtkTreeIter iter;
GdkDisplay *display;
+ GtkTreeIter iter;
GdkWindow *win;
+ display = gtk_widget_get_display (GTK_WIDGET (obj));
+
obj->priv->click_policy = click_policy;
if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_SINGLE)
{
if (obj->priv->hand_cursor == NULL)
{
- display = gtk_widget_get_display (GTK_WIDGET (obj));
- obj->priv->hand_cursor = gdk_cursor_new_for_display (display, GDK_HAND2);
+ obj->priv->hand_cursor = gdk_cursor_new_from_name (display, "pointer");
}
}
else if (click_policy == GEDIT_FILE_BROWSER_VIEW_CLICK_POLICY_DOUBLE)
@@ -335,10 +336,10 @@ set_click_policy_property (GeditFileBrowserView *obj,
win = gtk_widget_get_window (GTK_WIDGET (obj));
gdk_window_set_cursor (win, NULL);
- display = gtk_widget_get_display (GTK_WIDGET (obj));
-
if (display != NULL)
+ {
gdk_display_flush (display);
+ }
}
if (obj->priv->hand_cursor)
diff --git a/plugins/filebrowser/gedit-file-browser-widget.c b/plugins/filebrowser/gedit-file-browser-widget.c
index bd5a2d7..5e72b20 100644
--- a/plugins/filebrowser/gedit-file-browser-widget.c
+++ b/plugins/filebrowser/gedit-file-browser-widget.c
@@ -968,7 +968,7 @@ gedit_file_browser_widget_init (GeditFileBrowserWidget *obj)
free_name_icon);
display = gtk_widget_get_display (GTK_WIDGET (obj));
- obj->priv->busy_cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+ obj->priv->busy_cursor = gdk_cursor_new_from_name (display, "progress");
builder = gtk_builder_new ();
if (!gtk_builder_add_from_resource (builder,
@@ -1987,7 +1987,7 @@ set_busy (GeditFileBrowserWidget *obj,
GdkDisplay *display;
display = gtk_widget_get_display (GTK_WIDGET (obj));
- cursor = gdk_cursor_new_for_display (display, GDK_WATCH);
+ cursor = gdk_cursor_new_from_name (display, "progress");
gdk_window_set_cursor (window, cursor);
g_object_unref (cursor);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]