mirror of
https://github.com/brl/mutter.git
synced 2025-02-23 16:34:10 +00:00
display: Simplify cursor theme handling
This commit is contained in:
parent
5b83bfb1db
commit
490f1a6249
@ -400,9 +400,6 @@ const char* meta_event_detail_to_string (int d);
|
|||||||
void meta_display_queue_retheme_all_windows (MetaDisplay *display);
|
void meta_display_queue_retheme_all_windows (MetaDisplay *display);
|
||||||
void meta_display_retheme_all (void);
|
void meta_display_retheme_all (void);
|
||||||
|
|
||||||
void meta_display_set_cursor_theme (const char *theme,
|
|
||||||
int size);
|
|
||||||
|
|
||||||
void meta_display_ping_window (MetaWindow *window,
|
void meta_display_ping_window (MetaWindow *window,
|
||||||
guint32 timestamp,
|
guint32 timestamp,
|
||||||
MetaWindowPingFunc ping_reply_func,
|
MetaWindowPingFunc ping_reply_func,
|
||||||
|
@ -144,10 +144,12 @@ static MetaDisplay *the_display = NULL;
|
|||||||
static const char *gnome_wm_keybindings = "Mutter";
|
static const char *gnome_wm_keybindings = "Mutter";
|
||||||
static const char *net_wm_name = "Mutter";
|
static const char *net_wm_name = "Mutter";
|
||||||
|
|
||||||
|
static void update_cursor_theme (void);
|
||||||
static void update_window_grab_modifiers (MetaDisplay *display);
|
static void update_window_grab_modifiers (MetaDisplay *display);
|
||||||
|
|
||||||
static void prefs_changed_callback (MetaPreference pref,
|
static void prefs_changed_callback (MetaPreference pref,
|
||||||
void *data);
|
void *data);
|
||||||
|
|
||||||
static void
|
static void
|
||||||
meta_display_get_property(GObject *object,
|
meta_display_get_property(GObject *object,
|
||||||
guint prop_id,
|
guint prop_id,
|
||||||
@ -722,10 +724,7 @@ meta_display_open (void)
|
|||||||
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
|
meta_fatal ("X server doesn't have the XInput extension, version 2.2 or newer\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
update_cursor_theme ();
|
||||||
XcursorSetTheme (the_display->xdisplay, meta_prefs_get_cursor_theme ());
|
|
||||||
XcursorSetDefaultSize (the_display->xdisplay, meta_prefs_get_cursor_size ());
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Create the leader window here. Set its properties and
|
/* Create the leader window here. Set its properties and
|
||||||
* use the timestamp from one of the PropertyNotify events
|
* use the timestamp from one of the PropertyNotify events
|
||||||
@ -2281,16 +2280,23 @@ meta_display_retheme_all (void)
|
|||||||
meta_display_queue_retheme_all_windows (meta_get_display ());
|
meta_display_queue_retheme_all_windows (meta_get_display ());
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
static void
|
||||||
meta_display_set_cursor_theme (const char *theme,
|
set_cursor_theme (Display *xdisplay)
|
||||||
int size)
|
|
||||||
{
|
{
|
||||||
MetaDisplay *display = meta_get_display ();
|
XcursorSetTheme (xdisplay, meta_prefs_get_cursor_theme ());
|
||||||
|
XcursorSetDefaultSize (xdisplay, meta_prefs_get_cursor_size ());
|
||||||
|
}
|
||||||
|
|
||||||
XcursorSetTheme (display->xdisplay, theme);
|
static void
|
||||||
XcursorSetDefaultSize (display->xdisplay, size);
|
update_cursor_theme (void)
|
||||||
|
{
|
||||||
|
{
|
||||||
|
MetaDisplay *display = meta_get_display ();
|
||||||
|
set_cursor_theme (display->xdisplay);
|
||||||
|
|
||||||
meta_screen_update_cursor (display->screen);
|
if (display->screen)
|
||||||
|
meta_screen_update_cursor (display->screen);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2973,6 +2979,11 @@ prefs_changed_callback (MetaPreference pref,
|
|||||||
{
|
{
|
||||||
meta_bell_set_audible (display, meta_prefs_bell_is_audible ());
|
meta_bell_set_audible (display, meta_prefs_bell_is_audible ());
|
||||||
}
|
}
|
||||||
|
else if (pref == META_PREF_CURSOR_THEME ||
|
||||||
|
pref == META_PREF_CURSOR_SIZE)
|
||||||
|
{
|
||||||
|
update_cursor_theme ();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -544,11 +544,6 @@ prefs_changed_callback (MetaPreference pref,
|
|||||||
meta_display_retheme_all ();
|
meta_display_retheme_all ();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case META_PREF_CURSOR_THEME:
|
|
||||||
case META_PREF_CURSOR_SIZE:
|
|
||||||
meta_display_set_cursor_theme (meta_prefs_get_cursor_theme (),
|
|
||||||
meta_prefs_get_cursor_size ());
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
/* handled elsewhere or otherwise */
|
/* handled elsewhere or otherwise */
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user