Commit 1ea64e99 authored by Robert Roth's avatar Robert Roth

Replaced deprecated calls

parent 472526ab
......@@ -624,7 +624,9 @@ create_main_window (GsmApplication *app)
GtkStack *stack;
GtkMenuButton *process_menu_button;
GMenuModel *process_menu_model;
GdkDisplay *display;
GdkMonitor *monitor;
GdkRectangle monitor_geometry;
const char* session;
int width, height, xpos, ypos;
......@@ -653,8 +655,18 @@ create_main_window (GsmApplication *app)
g_settings_get (app->settings->gobj(), GSM_SETTING_WINDOW_STATE, "(iiii)",
&width, &height, &xpos, &ypos);
width = CLAMP (width, 50, gdk_screen_width ());
height = CLAMP (height, 50, gdk_screen_height ());
display = gdk_display_get_default ();
monitor = gdk_display_get_monitor_at_point (display, xpos, ypos);
if (monitor == NULL) {
monitor = gdk_display_get_monitor (display, 0);
}
gdk_monitor_get_geometry (monitor, &monitor_geometry);
width = CLAMP (width, 50, monitor_geometry.width);
height = CLAMP (height, 50, monitor_geometry.height);
xpos = CLAMP (xpos, 0, monitor_geometry.width - width);
ypos = CLAMP (ypos, 0, monitor_geometry.height - height);
gtk_window_set_default_size (GTK_WINDOW (main_window), width, height);
gtk_window_move (GTK_WINDOW (main_window), xpos, ypos);
......
......@@ -122,9 +122,7 @@ cb_tree_popup_menu (GtkWidget *widget, gpointer data)
{
GsmApplication *app = (GsmApplication *) data;
gtk_menu_popup (GTK_MENU (app->popup_menu),
NULL, NULL, NULL, NULL,
0, gtk_get_current_event_time ());
gtk_menu_popup_at_pointer (GTK_MENU (app->popup_menu), NULL);
return TRUE;
}
......
......@@ -107,9 +107,7 @@ cb_column_header_clicked (GtkTreeViewColumn *column, GdkEventButton *event, gpoi
GtkMenu *menu = GTK_MENU (data);
if (event->button == GDK_BUTTON_SECONDARY) {
gtk_menu_popup (menu, NULL, NULL, NULL, NULL,
event->button,
event->time);
gtk_menu_popup_at_pointer (menu, (GdkEvent*)event);
return TRUE;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment