Fix some deprecation warnings (#289)
* xed-app.c: replace get_active_window with gtk_application version This allows us to remove quite a bit of code, some of which uses deprecated functions, so it also has the benefit of cleaning up the deprecation warnings a bit. * Switch a couple uses of gtk_show_uri with gtk_show_uri_on_window gtk_show_uri is deprecated. * Taglist plugin: remove call to gtk_tree_view_set_rules_hint This function is deprecated, and it already defaults to false in any case, so it wasn't doing anything anyway. * Deprecations: move all instances of gtk_menu_popup to newer methods In a couple cases this simplifies the code quite a bit * Replace deprecated gdk_window_at_pointer with newer method
This commit is contained in:
parent
2ebff67c9c
commit
67892da099
|
@ -458,8 +458,6 @@ xed_help_display
|
|||
GBOOLEAN_TO_POINTER
|
||||
GPOINTER_TO_BOOLEAN
|
||||
IS_VALID_BOOLEAN
|
||||
xed_utils_menu_position_under_widget
|
||||
xed_utils_menu_position_under_tree_view
|
||||
xed_gtk_button_new_with_stock_icon
|
||||
xed_dialog_add_button
|
||||
xed_utils_escape_underscores
|
||||
|
@ -474,8 +472,6 @@ xed_warning
|
|||
xed_utils_make_valid_utf8
|
||||
xed_utils_uri_get_dirname
|
||||
xed_utils_replace_home_dir_with_tilde
|
||||
xed_utils_get_current_workspace
|
||||
xed_utils_get_window_workspace
|
||||
xed_utils_activate_url
|
||||
xed_utils_is_valid_uri
|
||||
xed_utils_get_glade_widgets
|
||||
|
|
|
@ -1247,6 +1247,7 @@ popup_menu (XedFileBrowserWidget *obj,
|
|||
GtkTreeModel *model)
|
||||
{
|
||||
GtkWidget *menu;
|
||||
GtkTreeView *tree;
|
||||
|
||||
if (XED_IS_FILE_BROWSER_STORE (model))
|
||||
{
|
||||
|
@ -1263,16 +1264,18 @@ popup_menu (XedFileBrowserWidget *obj,
|
|||
|
||||
g_return_val_if_fail (menu != NULL, FALSE);
|
||||
|
||||
tree = GTK_TREE_VIEW (obj->priv->treeview);
|
||||
|
||||
if (event != NULL)
|
||||
{
|
||||
GtkTreeSelection *selection;
|
||||
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (obj->priv->treeview));
|
||||
selection = gtk_tree_view_get_selection (tree);
|
||||
|
||||
if (gtk_tree_selection_count_selected_rows (selection) <= 1)
|
||||
{
|
||||
GtkTreePath *path;
|
||||
|
||||
if (gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (obj->priv->treeview),
|
||||
if (gtk_tree_view_get_path_at_pos (tree,
|
||||
(gint)event->x, (gint)event->y,
|
||||
&path, NULL, NULL, NULL))
|
||||
{
|
||||
|
@ -1282,14 +1285,38 @@ popup_menu (XedFileBrowserWidget *obj,
|
|||
}
|
||||
}
|
||||
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
||||
xed_utils_menu_position_under_tree_view,
|
||||
obj->priv->treeview, 0,
|
||||
gtk_get_current_event_time ());
|
||||
GtkTreeModel *model;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
|
||||
model = gtk_tree_view_get_model (tree);
|
||||
g_return_val_if_fail (model != NULL, FALSE);
|
||||
|
||||
selection = gtk_tree_view_get_selection (tree);
|
||||
g_return_val_if_fail (selection != NULL, FALSE);
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GdkRectangle rect;
|
||||
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
gtk_tree_view_get_cell_area (tree, path, gtk_tree_view_get_column (tree, 0), &rect);
|
||||
gtk_menu_popup_at_rect (GTK_MENU (menu), gtk_widget_get_window (GTK_WIDGET (tree)),
|
||||
&rect, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
|
||||
|
||||
gtk_tree_path_free (path);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_menu_popup_at_widget (GTK_MENU (menu), GTK_WIDGET (obj->priv->treeview),
|
||||
GDK_GRAVITY_SOUTH, GDK_GRAVITY_NORTH, NULL);
|
||||
}
|
||||
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
|
||||
}
|
||||
|
||||
|
@ -2329,7 +2356,8 @@ directory_open (XedFileBrowserWidget *obj,
|
|||
|
||||
uri = g_file_get_uri (location);
|
||||
|
||||
if (!gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (obj)), uri, GDK_CURRENT_TIME, &error))
|
||||
if (!gtk_show_uri_on_window (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (obj))),
|
||||
uri, GDK_CURRENT_TIME, &error))
|
||||
{
|
||||
g_signal_emit (obj, signals[ERROR], 0, XED_FILE_BROWSER_ERROR_OPEN_DIRECTORY, error->message);
|
||||
|
||||
|
|
|
@ -712,7 +712,6 @@ xed_taglist_plugin_panel_init (XedTaglistPluginPanel *panel)
|
|||
panel->priv->tag_groups_combo,
|
||||
ATK_RELATION_CONTROLLED_BY);
|
||||
|
||||
gtk_tree_view_set_rules_hint (GTK_TREE_VIEW (panel->priv->tags_list), FALSE);
|
||||
gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (panel->priv->tags_list), FALSE);
|
||||
|
||||
g_object_set (panel->priv->tags_list, "has-tooltip", TRUE, NULL);
|
||||
|
|
|
@ -356,93 +356,6 @@ xed_app_startup (GApplication *application)
|
|||
app);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_in_viewport (GtkWindow *window,
|
||||
GdkScreen *screen,
|
||||
gint workspace,
|
||||
gint viewport_x,
|
||||
gint viewport_y)
|
||||
{
|
||||
GdkScreen *s;
|
||||
GdkDisplay *display;
|
||||
GdkWindow *gdkwindow;
|
||||
const gchar *cur_name;
|
||||
const gchar *name;
|
||||
gint cur_n;
|
||||
gint n;
|
||||
gint ws;
|
||||
gint sc_width, sc_height;
|
||||
gint x, y, width, height;
|
||||
gint vp_x, vp_y;
|
||||
|
||||
/* Check for screen and display match */
|
||||
display = gdk_screen_get_display (screen);
|
||||
cur_name = gdk_display_get_name (display);
|
||||
cur_n = gdk_screen_get_number (screen);
|
||||
|
||||
s = gtk_window_get_screen (window);
|
||||
display = gdk_screen_get_display (s);
|
||||
name = gdk_display_get_name (display);
|
||||
n = gdk_screen_get_number (s);
|
||||
|
||||
if (strcmp (cur_name, name) != 0 || cur_n != n)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Check for workspace match */
|
||||
ws = xed_utils_get_window_workspace (window);
|
||||
if (ws != workspace && ws != XED_ALL_WORKSPACES)
|
||||
{
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/* Check for viewport match */
|
||||
gdkwindow = gtk_widget_get_window (GTK_WIDGET (window));
|
||||
gdk_window_get_position (gdkwindow, &x, &y);
|
||||
width = gdk_window_get_width (gdkwindow);
|
||||
height = gdk_window_get_height (gdkwindow);
|
||||
xed_utils_get_current_viewport (screen, &vp_x, &vp_y);
|
||||
x += vp_x;
|
||||
y += vp_y;
|
||||
|
||||
sc_width = gdk_screen_get_width (screen);
|
||||
sc_height = gdk_screen_get_height (screen);
|
||||
|
||||
return x + width * .25 >= viewport_x &&
|
||||
x + width * .75 <= viewport_x + sc_width &&
|
||||
y >= viewport_y &&
|
||||
y + height <= viewport_y + sc_height;
|
||||
}
|
||||
|
||||
static XedWindow *
|
||||
get_active_window (GtkApplication *app)
|
||||
{
|
||||
GdkScreen *screen;
|
||||
guint workspace;
|
||||
gint viewport_x, viewport_y;
|
||||
GList *windows, *l;
|
||||
|
||||
screen = gdk_screen_get_default ();
|
||||
|
||||
workspace = xed_utils_get_current_workspace (screen);
|
||||
xed_utils_get_current_viewport (screen, &viewport_x, &viewport_y);
|
||||
|
||||
/* Gtk documentation says the window list is always in MRU order */
|
||||
windows = gtk_application_get_windows (app);
|
||||
for (l = windows; l != NULL; l = l->next)
|
||||
{
|
||||
GtkWindow *window = l->data;
|
||||
|
||||
if (is_in_viewport (window, screen, workspace, viewport_x, viewport_y))
|
||||
{
|
||||
return XED_WINDOW (window);
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void
|
||||
set_command_line_wait (XedApp *app,
|
||||
XedTab *tab)
|
||||
|
@ -479,7 +392,7 @@ open_files (GApplication *application,
|
|||
|
||||
if (!new_window)
|
||||
{
|
||||
window = get_active_window (GTK_APPLICATION (application));
|
||||
window = XED_WINDOW (gtk_application_get_active_window (GTK_APPLICATION (application)));
|
||||
}
|
||||
|
||||
if (window == NULL)
|
||||
|
@ -1251,7 +1164,8 @@ xed_app_show_help (XedApp *app,
|
|||
link = g_strdup_printf ("help:%s", name);
|
||||
}
|
||||
|
||||
ret = gtk_show_uri (gtk_widget_get_screen (GTK_WIDGET (parent)), link, GDK_CURRENT_TIME, &error);
|
||||
ret = gtk_show_uri_on_window (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (parent))),
|
||||
link, GDK_CURRENT_TIME, &error);
|
||||
|
||||
g_free (link);
|
||||
|
||||
|
|
|
@ -525,20 +525,7 @@ show_popup_menu (XedDocumentsPanel *panel,
|
|||
menu = gtk_ui_manager_get_widget (xed_window_get_ui_manager (panel->priv->window), "/NotebookPopup");
|
||||
g_return_val_if_fail (menu != NULL, FALSE);
|
||||
|
||||
if (event != NULL)
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
||||
NULL, NULL,
|
||||
event->button, event->time);
|
||||
}
|
||||
else
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU (menu), NULL, NULL,
|
||||
(GtkMenuPositionFunc) menu_position, panel,
|
||||
0, gtk_get_current_event_time ());
|
||||
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL (menu), FALSE);
|
||||
}
|
||||
gtk_menu_popup_at_pointer (GTK_MENU (menu), (GdkEvent *) event);
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
|
|
@ -186,13 +186,17 @@ static XedNotebook *
|
|||
find_notebook_at_pointer (gint abs_x,
|
||||
gint abs_y)
|
||||
{
|
||||
GdkSeat *seat;
|
||||
GdkDevice *device;
|
||||
GdkWindow *win_at_pointer;
|
||||
GdkWindow *toplevel_win;
|
||||
gpointer toplevel = NULL;
|
||||
gint x, y;
|
||||
|
||||
/* FIXME multi-head */
|
||||
win_at_pointer = gdk_window_at_pointer (&x, &y);
|
||||
seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
device = gdk_seat_get_pointer (seat);
|
||||
win_at_pointer = gdk_device_get_window_at_position (device, &x, &y);
|
||||
|
||||
if (win_at_pointer == NULL)
|
||||
{
|
||||
/* We are outside all windows of the same application */
|
||||
|
|
|
@ -499,7 +499,7 @@ multi_button_clicked (GtkWidget *button,
|
|||
gtk_menu_attach (GTK_MENU (m), i, 1, 2, 1, 2);
|
||||
g_signal_connect (i, "activate", G_CALLBACK (on_2x2_clicked), preview);
|
||||
|
||||
gtk_menu_popup (GTK_MENU (m), NULL, NULL, NULL, preview, 0, GDK_CURRENT_TIME);
|
||||
gtk_menu_popup_at_widget (GTK_MENU (m), button, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
280
xed/xed-utils.c
280
xed/xed-utils.c
|
@ -54,99 +54,6 @@
|
|||
|
||||
#define STDIN_DELAY_MICROSECONDS 100000
|
||||
|
||||
static void
|
||||
widget_get_origin (GtkWidget *widget,
|
||||
gint *x,
|
||||
gint *y)
|
||||
|
||||
{
|
||||
GdkWindow *window;
|
||||
|
||||
window = gtk_widget_get_window (widget);
|
||||
gdk_window_get_origin (window, x, y);
|
||||
}
|
||||
|
||||
void
|
||||
xed_utils_menu_position_under_widget (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkRequisition requisition;
|
||||
GtkAllocation allocation;
|
||||
|
||||
widget = GTK_WIDGET (user_data);
|
||||
widget_get_origin (widget, x, y);
|
||||
|
||||
gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
|
||||
|
||||
gtk_widget_get_allocation (widget, &allocation);
|
||||
|
||||
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
*x += allocation.x + allocation.width - requisition.width;
|
||||
}
|
||||
else
|
||||
{
|
||||
*x += allocation.x;
|
||||
}
|
||||
|
||||
*y += allocation.y + allocation.height;
|
||||
|
||||
*push_in = TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
xed_utils_menu_position_under_tree_view (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data)
|
||||
{
|
||||
GtkTreeView *tree = GTK_TREE_VIEW (user_data);
|
||||
GtkTreeModel *model;
|
||||
GtkTreeSelection *selection;
|
||||
GtkTreeIter iter;
|
||||
|
||||
model = gtk_tree_view_get_model (tree);
|
||||
g_return_if_fail (model != NULL);
|
||||
|
||||
selection = gtk_tree_view_get_selection (tree);
|
||||
g_return_if_fail (selection != NULL);
|
||||
|
||||
if (gtk_tree_selection_get_selected (selection, NULL, &iter))
|
||||
{
|
||||
GtkTreePath *path;
|
||||
GdkRectangle rect;
|
||||
|
||||
widget_get_origin (GTK_WIDGET (tree), x, y);
|
||||
|
||||
path = gtk_tree_model_get_path (model, &iter);
|
||||
gtk_tree_view_get_cell_area (tree, path,
|
||||
gtk_tree_view_get_column (tree, 0), /* FIXME 0 for RTL ? */
|
||||
&rect);
|
||||
gtk_tree_path_free (path);
|
||||
|
||||
*x += rect.x;
|
||||
*y += rect.y + rect.height;
|
||||
|
||||
if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL)
|
||||
{
|
||||
GtkRequisition requisition;
|
||||
gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition);
|
||||
|
||||
*x += rect.width - requisition.width;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* no selection -> regular "under widget" positioning */
|
||||
xed_utils_menu_position_under_widget (menu, x, y, push_in, tree);
|
||||
}
|
||||
}
|
||||
|
||||
/* FIXME: remove this with gtk 2.12, it has gdk_color_to_string */
|
||||
gchar *
|
||||
xed_gdk_color_to_string (GdkColor color)
|
||||
|
@ -630,193 +537,6 @@ xed_utils_replace_home_dir_with_tilde (const gchar *uri)
|
|||
return g_strdup (uri);
|
||||
}
|
||||
|
||||
/* the following two functions are courtesy of galeon */
|
||||
|
||||
/**
|
||||
* xed_utils_get_current_workspace:
|
||||
*
|
||||
* Get the current workspace
|
||||
*
|
||||
* Get the currently visible workspace for the #GdkScreen.
|
||||
*
|
||||
* If the X11 window property isn't found, 0 (the first workspace)
|
||||
* is returned.
|
||||
*/
|
||||
guint
|
||||
xed_utils_get_current_workspace (GdkScreen *screen)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkWindow *root_win;
|
||||
GdkDisplay *display;
|
||||
guint ret = 0;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SCREEN (screen), 0);
|
||||
|
||||
root_win = gdk_screen_get_root_window (screen);
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
Atom type;
|
||||
gint format;
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
guint *current_desktop;
|
||||
gint err, result;
|
||||
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (root_win),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_CURRENT_DESKTOP"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (gpointer) ¤t_desktop);
|
||||
err = gdk_error_trap_pop ();
|
||||
|
||||
if (err != Success || result != Success)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (type == XA_CARDINAL && format == 32 && nitems > 0)
|
||||
{
|
||||
ret = current_desktop[0];
|
||||
}
|
||||
|
||||
XFree (current_desktop);
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
/* FIXME: on mac etc proably there are native APIs
|
||||
* to get the current workspace etc */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xed_utils_get_window_workspace:
|
||||
*
|
||||
* Get the workspace the window is on
|
||||
*
|
||||
* This function gets the workspace that the #GtkWindow is visible on,
|
||||
* it returns XED_ALL_WORKSPACES if the window is sticky, or if
|
||||
* the window manager doesn support this function
|
||||
*/
|
||||
guint
|
||||
xed_utils_get_window_workspace (GtkWindow *gtkwindow)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkWindow *window;
|
||||
GdkDisplay *display;
|
||||
Atom type;
|
||||
gint format;
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
guint *workspace;
|
||||
gint err, result;
|
||||
guint ret = XED_ALL_WORKSPACES;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_WINDOW (gtkwindow), 0);
|
||||
g_return_val_if_fail (gtk_widget_get_realized (GTK_WIDGET (gtkwindow)), 0);
|
||||
|
||||
window = gtk_widget_get_window (GTK_WIDGET (gtkwindow));
|
||||
display = gdk_window_get_display (window);
|
||||
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (window),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_DESKTOP"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (gpointer) &workspace);
|
||||
err = gdk_error_trap_pop ();
|
||||
|
||||
if (err != Success || result != Success)
|
||||
{
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (type == XA_CARDINAL && format == 32 && nitems > 0)
|
||||
{
|
||||
ret = workspace[0];
|
||||
}
|
||||
|
||||
XFree (workspace);
|
||||
}
|
||||
|
||||
return ret;
|
||||
#else
|
||||
/* FIXME: on mac etc proably there are native APIs
|
||||
* to get the current workspace etc */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* xed_utils_get_current_viewport:
|
||||
*
|
||||
* Get the current viewport origin
|
||||
*
|
||||
* Get the currently visible viewport origin for the #GdkScreen.
|
||||
*
|
||||
* If the X11 window property isn't found, (0, 0) is returned.
|
||||
*/
|
||||
void
|
||||
xed_utils_get_current_viewport (GdkScreen *screen,
|
||||
gint *x,
|
||||
gint *y)
|
||||
{
|
||||
#ifdef GDK_WINDOWING_X11
|
||||
GdkWindow *root_win;
|
||||
GdkDisplay *display;
|
||||
Atom type;
|
||||
gint format;
|
||||
gulong nitems;
|
||||
gulong bytes_after;
|
||||
gulong *coordinates;
|
||||
gint err, result;
|
||||
|
||||
g_return_if_fail (GDK_IS_SCREEN (screen));
|
||||
g_return_if_fail (x != NULL && y != NULL);
|
||||
|
||||
/* Default values for the viewport origin */
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
|
||||
root_win = gdk_screen_get_root_window (screen);
|
||||
display = gdk_screen_get_display (screen);
|
||||
|
||||
if (GDK_IS_X11_DISPLAY (display))
|
||||
{
|
||||
gdk_error_trap_push ();
|
||||
result = XGetWindowProperty (GDK_DISPLAY_XDISPLAY (display), GDK_WINDOW_XID (root_win),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_DESKTOP_VIEWPORT"),
|
||||
0, G_MAXLONG, False, XA_CARDINAL, &type, &format, &nitems,
|
||||
&bytes_after, (void*) &coordinates);
|
||||
err = gdk_error_trap_pop ();
|
||||
|
||||
if (err != Success || result != Success)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (type != XA_CARDINAL || format != 32 || nitems < 2)
|
||||
{
|
||||
XFree (coordinates);
|
||||
return;
|
||||
}
|
||||
|
||||
*x = coordinates[0];
|
||||
*y = coordinates[1];
|
||||
XFree (coordinates);
|
||||
}
|
||||
#else
|
||||
/* FIXME: on mac etc proably there are native APIs
|
||||
* to get the current workspace etc */
|
||||
*x = 0;
|
||||
*y = 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
static gboolean
|
||||
is_valid_scheme_character (gchar c)
|
||||
{
|
||||
|
|
|
@ -48,18 +48,6 @@ G_BEGIN_DECLS
|
|||
|
||||
enum { XED_ALL_WORKSPACES = 0xffffffff };
|
||||
|
||||
void xed_utils_menu_position_under_widget (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data);
|
||||
|
||||
void xed_utils_menu_position_under_tree_view (GtkMenu *menu,
|
||||
gint *x,
|
||||
gint *y,
|
||||
gboolean *push_in,
|
||||
gpointer user_data);
|
||||
|
||||
gchar *xed_gdk_color_to_string (GdkColor color);
|
||||
|
||||
gchar *xed_utils_escape_underscores (const gchar *text,
|
||||
|
@ -97,14 +85,6 @@ gchar *xed_utils_location_get_dirname_for_display (GFile *location);
|
|||
|
||||
gchar *xed_utils_replace_home_dir_with_tilde (const gchar *uri);
|
||||
|
||||
guint xed_utils_get_current_workspace (GdkScreen *screen);
|
||||
|
||||
guint xed_utils_get_window_workspace (GtkWindow *gtkwindow);
|
||||
|
||||
void xed_utils_get_current_viewport (GdkScreen *screen,
|
||||
gint *x,
|
||||
gint *y);
|
||||
|
||||
gboolean xed_utils_is_valid_location (GFile *location);
|
||||
|
||||
gboolean xed_utils_get_ui_objects (const gchar *filename,
|
||||
|
|
|
@ -401,7 +401,7 @@ show_line_numbers_menu (GtkWidget *view,
|
|||
GtkWidget *menu;
|
||||
|
||||
menu = create_line_numbers_menu (view);
|
||||
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent *) event);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
|
|
@ -2806,7 +2806,8 @@ show_notebook_popup_menu (GtkNotebook *notebook,
|
|||
#endif
|
||||
if (event != NULL)
|
||||
{
|
||||
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, NULL, NULL, event->button, event->time);
|
||||
gtk_menu_popup_at_pointer (GTK_MENU(menu), (GdkEvent *) event);
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2818,8 +2819,7 @@ show_notebook_popup_menu (GtkNotebook *notebook,
|
|||
|
||||
tab_label = gtk_notebook_get_tab_label (notebook, tab);
|
||||
|
||||
gtk_menu_popup (GTK_MENU(menu), NULL, NULL, xed_utils_menu_position_under_widget, tab_label, 0,
|
||||
gtk_get_current_event_time ());
|
||||
gtk_menu_popup_at_widget (GTK_MENU (menu), tab_label, GDK_GRAVITY_SOUTH_WEST, GDK_GRAVITY_NORTH_WEST, NULL);
|
||||
|
||||
gtk_menu_shell_select_first (GTK_MENU_SHELL(menu), FALSE);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue