Skip to content

Commit

Permalink
Position preferences menu on the left of the button
Browse files Browse the repository at this point in the history
  • Loading branch information
Siyan Panayotov committed Apr 13, 2014
1 parent 6953b29 commit c9d6db3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vnr-window.c
Expand Up @@ -990,17 +990,20 @@ static void
vnr_window_main_menu_position (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data)
{
VnrWindow *window = VNR_WINDOW(user_data);
GtkWidget *button = window->properties_button;
GtkWidget *button = window->properties_button;
GdkWindow *gdk_window = gtk_widget_get_window(button);
GtkRequisition req = {0, 0};

gdk_window_get_position(gdk_window, x, y);

// in maximuzed and fullscreen states gdk_window_get_position returns 0
if ( *x == 0 && gtk_widget_get_visible ( get_fs_controls(window)) ) {
*x -= get_fs_controls(window)->allocation.width;
}

gtk_widget_size_request(GTK_WIDGET(menu), &req);

*x += window->toolbar->allocation.width - button->allocation.width;
*x += window->toolbar->allocation.width - req.width;
*y += button->allocation.height;
}

Expand Down

0 comments on commit c9d6db3

Please sign in to comment.