diff options
author | Andre Klapper <a9016009@gmx.de> | 2010-04-23 00:46:25 +0200 |
---|---|---|
committer | Andre Klapper <a9016009@gmx.de> | 2010-04-23 16:48:59 +0200 |
commit | d596fcf9846bb31823671ae83207ae796685e93d (patch) | |
tree | cf71205faa50cefa0cf1890eda70cf182c29ce5f /cpufreq | |
parent | b4fdf2c7deee1aee18e34f7344cc2e59a9001e89 (diff) |
Compile with -DGSEAL_ENABLE. Fixes bug 612473. Bumps gtk+ requirement to 2.18.
Diffstat (limited to 'cpufreq')
-rw-r--r-- | cpufreq/src/cpufreq-applet.c | 22 | ||||
-rw-r--r-- | cpufreq/src/cpufreq-popup.c | 4 |
2 files changed, 16 insertions, 10 deletions
diff --git a/cpufreq/src/cpufreq-applet.c b/cpufreq/src/cpufreq-applet.c index 7d9495aad..3ee9e75d2 100644 --- a/cpufreq/src/cpufreq-applet.c +++ b/cpufreq/src/cpufreq-applet.c @@ -419,6 +419,7 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu, { GtkWidget *widget; GtkRequisition requisition; + GtkAllocation allocation; gint menu_xpos; gint menu_ypos; @@ -426,10 +427,12 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu, gtk_widget_size_request (GTK_WIDGET (menu), &requisition); - gdk_window_get_origin (widget->window, &menu_xpos, &menu_ypos); + gdk_window_get_origin (gtk_widget_get_window (widget), &menu_xpos, &menu_ypos); - menu_xpos += widget->allocation.x; - menu_ypos += widget->allocation.y; + gtk_widget_get_allocation (widget, &allocation); + + menu_xpos += allocation.x; + menu_ypos += allocation.y; switch (panel_applet_get_orient (PANEL_APPLET (widget))) { case PANEL_APPLET_ORIENT_DOWN: @@ -437,14 +440,14 @@ cpufreq_applet_popup_position_menu (GtkMenu *menu, if (menu_ypos > gdk_screen_get_height (gtk_widget_get_screen (widget)) / 2) menu_ypos -= requisition.height; else - menu_ypos += widget->allocation.height; + menu_ypos += allocation.height; break; case PANEL_APPLET_ORIENT_RIGHT: case PANEL_APPLET_ORIENT_LEFT: if (menu_xpos > gdk_screen_get_width (gtk_widget_get_screen (widget)) / 2) menu_xpos -= requisition.width; else - menu_xpos += widget->allocation.width; + menu_xpos += allocation.width; break; default: g_assert_not_reached (); @@ -530,19 +533,22 @@ static void cpufreq_applet_change_orient (PanelApplet *pa, PanelAppletOrient orient) { CPUFreqApplet *applet; + GtkAllocation allocation; gint size; applet = CPUFREQ_APPLET (pa); applet->orient = orient; + gtk_widget_get_allocation (GTK_WIDGET (applet), &allocation); + if ((orient == PANEL_APPLET_ORIENT_LEFT) || (orient == PANEL_APPLET_ORIENT_RIGHT)) { - size = GTK_WIDGET (applet)->allocation.width; + size = allocation.width; gtk_alignment_set (GTK_ALIGNMENT (applet->container), 0.5, 0.5, 0, 0); } else { - size = GTK_WIDGET (applet)->allocation.height; + size = allocation.height; gtk_alignment_set (GTK_ALIGNMENT (applet->container), 0, 0.5, 0, 0); } @@ -814,7 +820,7 @@ cpufreq_applet_get_widget_size (CPUFreqApplet *applet, GtkRequisition req; gint size; - if (!GTK_WIDGET_VISIBLE (widget)) + if (!gtk_widget_get_visible (widget)) return 0; gtk_widget_size_request (widget, &req); diff --git a/cpufreq/src/cpufreq-popup.c b/cpufreq/src/cpufreq-popup.c index 806f604fa..9bc100e51 100644 --- a/cpufreq/src/cpufreq-popup.c +++ b/cpufreq/src/cpufreq-popup.c @@ -198,7 +198,7 @@ cpufreq_popup_frequencies_menu_activate (GtkAction *action, cpu = cpufreq_monitor_get_cpu (popup->priv->monitor); name = gtk_action_get_name (action); freq = (guint) atoi (name + strlen ("Frequency")); - parent = GDK_WINDOW_XID (popup->priv->parent->window); + parent = GDK_WINDOW_XID (gtk_widget_get_window (popup->priv->parent)); cpufreq_selector_set_frequency_async (selector, cpu, freq, parent); @@ -222,7 +222,7 @@ cpufreq_popup_governors_menu_activate (GtkAction *action, cpu = cpufreq_monitor_get_cpu (popup->priv->monitor); name = gtk_action_get_name (action); governor = name + strlen ("Governor"); - parent = GDK_WINDOW_XID (popup->priv->parent->window); + parent = GDK_WINDOW_XID (gtk_widget_get_window (popup->priv->parent)); cpufreq_selector_set_governor_async (selector, cpu, governor, parent); } |