]> www.fi.muni.cz Git - evince.git/blobdiff - shell/ev-sidebar.c
[libview] Port to latest rendering-cleanup-next branch
[evince.git] / shell / ev-sidebar.c
index 23d51f99b2e3fb704c12f43096f71d06509a8be4..cf5f2a306c348819f4612cd58b34f8c845edcfb3 100644 (file)
@@ -17,7 +17,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
 #ifdef HAVE_CONFIG_H
@@ -205,17 +205,19 @@ ev_sidebar_menu_position_under (GtkMenu  *menu,
                                gboolean *push_in,
                                gpointer  user_data)
 {
-       GtkWidget *widget;
+       GtkWidget    *widget;
+       GtkAllocation allocation;
 
        g_return_if_fail (GTK_IS_BUTTON (user_data));
        g_return_if_fail (!gtk_widget_get_has_window (GTK_WIDGET (user_data)));
 
        widget = GTK_WIDGET (user_data);
           
-       gdk_window_get_origin (widget->window, x, y);
+       gdk_window_get_origin (gtk_widget_get_window (widget), x, y);
+       gtk_widget_get_allocation (widget, &allocation);
           
-       *x += widget->allocation.x;
-       *y += widget->allocation.y + widget->allocation.height;
+       *x += allocation.x;
+       *y += allocation.y + allocation.height;
           
        *push_in = FALSE;
 }
@@ -229,9 +231,11 @@ ev_sidebar_select_button_press_cb (GtkWidget      *widget,
 
        if (event->button == 1) {
                GtkRequisition requisition;
+               GtkAllocation allocation;
                gint width;
-               
-               width = widget->allocation.width;
+
+               gtk_widget_get_allocation (widget, &allocation);
+               width = allocation.width;
                gtk_widget_set_size_request (ev_sidebar->priv->menu, -1, -1);
                gtk_widget_size_request (ev_sidebar->priv->menu, &requisition);
                gtk_widget_set_size_request (ev_sidebar->priv->menu,
@@ -257,10 +261,10 @@ ev_sidebar_select_button_key_press_cb (GtkWidget   *widget,
 {
        EvSidebar *ev_sidebar = EV_SIDEBAR (user_data);
           
-       if (event->keyval == GDK_space ||
-           event->keyval == GDK_KP_Space ||
-           event->keyval == GDK_Return ||
-           event->keyval == GDK_KP_Enter) {
+       if (event->keyval == GDK_KEY_space ||
+           event->keyval == GDK_KEY_KP_Space ||
+           event->keyval == GDK_KEY_Return ||
+           event->keyval == GDK_KEY_KP_Enter) {
                gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (widget), TRUE);
                gtk_menu_popup (GTK_MENU (ev_sidebar->priv->menu),
                                NULL, NULL, ev_sidebar_menu_position_under, widget,