[gnome-settings-daemon] media-keys: Remove is_composited path
- From: Bastien Nocera <hadess src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-settings-daemon] media-keys: Remove is_composited path
- Date: Mon, 16 Apr 2012 16:04:16 +0000 (UTC)
commit ac771c25d1699b7e5d5bca258602a0654f3245ef
Author: Bastien Nocera <hadess hadess net>
Date: Mon Apr 16 17:03:35 2012 +0100
media-keys: Remove is_composited path
It should look alright-ish on non-composited displays.
plugins/media-keys/gsd-osd-window.c | 42 +++++-----------------------------
plugins/media-keys/gsd-osd-window.h | 1 -
2 files changed, 7 insertions(+), 36 deletions(-)
---
diff --git a/plugins/media-keys/gsd-osd-window.c b/plugins/media-keys/gsd-osd-window.c
index 40d6433..d1f6780 100644
--- a/plugins/media-keys/gsd-osd-window.c
+++ b/plugins/media-keys/gsd-osd-window.c
@@ -49,7 +49,6 @@
struct GsdOsdWindowPrivate
{
- guint is_composited : 1;
guint hide_timeout_id;
guint fade_timeout_id;
double fade_out_alpha;
@@ -102,14 +101,10 @@ fade_timeout (GsdOsdWindow *window)
static gboolean
hide_timeout (GsdOsdWindow *window)
{
- if (window->priv->is_composited) {
- window->priv->hide_timeout_id = 0;
- window->priv->fade_timeout_id = g_timeout_add (FADE_TIMEOUT,
- (GSourceFunc) fade_timeout,
- window);
- } else {
- gtk_widget_hide (GTK_WIDGET (window));
- }
+ window->priv->hide_timeout_id = 0;
+ window->priv->fade_timeout_id = g_timeout_add (FADE_TIMEOUT,
+ (GSourceFunc) fade_timeout,
+ window);
return FALSE;
}
@@ -132,14 +127,7 @@ remove_hide_timeout (GsdOsdWindow *window)
static void
add_hide_timeout (GsdOsdWindow *window)
{
- int timeout;
-
- if (window->priv->is_composited) {
- timeout = DIALOG_FADE_TIMEOUT;
- } else {
- timeout = DIALOG_TIMEOUT;
- }
- window->priv->hide_timeout_id = g_timeout_add (timeout,
+ window->priv->hide_timeout_id = g_timeout_add (DIALOG_FADE_TIMEOUT,
(GSourceFunc) hide_timeout,
window);
}
@@ -449,10 +437,7 @@ draw_when_composited (GtkWidget *widget, cairo_t *orig_cr)
cairo_paint (cr);
/* draw a box */
- if (window->priv->is_composited)
- corner_radius = height / 10;
- else
- corner_radius = 0.0;
+ corner_radius = height / 10;
gsd_osd_window_draw_rounded_rectangle (cr, 1.0, 0.0, 0.0, corner_radius, width-1, height-1);
gtk_style_context_get_background_color (context, GTK_STATE_NORMAL, &acolor);
gsd_osd_window_color_reverse (&acolor);
@@ -653,18 +638,6 @@ gsd_osd_window_class_init (GsdOsdWindowClass *klass)
}
/**
- * gsd_osd_window_is_composited:
- * @window: a #GsdOsdWindow
- *
- * Return value: whether the window was created on a composited screen.
- */
-gboolean
-gsd_osd_window_is_composited (GsdOsdWindow *window)
-{
- return window->priv->is_composited;
-}
-
-/**
* gsd_osd_window_is_valid:
* @window: a #GsdOsdWindow
*
@@ -688,7 +661,7 @@ gsd_osd_window_is_valid (GsdOsdWindow *window)
window->priv->screen_height != mon_rect.height)
return FALSE;
- return gdk_screen_is_composited (screen) == window->priv->is_composited;
+ return TRUE;
}
static void
@@ -703,7 +676,6 @@ gsd_osd_window_init (GsdOsdWindow *window)
screen = gtk_widget_get_screen (GTK_WIDGET (window));
- window->priv->is_composited = gdk_screen_is_composited (screen);
window->priv->monitor = gdk_screen_get_primary_monitor (screen);
gdk_screen_get_monitor_geometry (screen, window->priv->monitor, &monitor);
window->priv->screen_width = monitor.width;
diff --git a/plugins/media-keys/gsd-osd-window.h b/plugins/media-keys/gsd-osd-window.h
index 18ceb24..69c743c 100644
--- a/plugins/media-keys/gsd-osd-window.h
+++ b/plugins/media-keys/gsd-osd-window.h
@@ -74,7 +74,6 @@ struct GsdOsdWindowClass {
GType gsd_osd_window_get_type (void);
GtkWidget * gsd_osd_window_new (void);
-gboolean gsd_osd_window_is_composited (GsdOsdWindow *window);
gboolean gsd_osd_window_is_valid (GsdOsdWindow *window);
void gsd_osd_window_update_and_hide (GsdOsdWindow *window);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]