[baobab] Do not use deprecated popup functions
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab] Do not use deprecated popup functions
- Date: Wed, 10 Jun 2020 07:56:37 +0000 (UTC)
commit ba19ac54c92211338368a21e148e2ccd13924b3c
Author: Stefano Facchini <stefano facchini gmail com>
Date: Wed Jun 10 09:54:57 2020 +0200
Do not use deprecated popup functions
src/baobab-chart.vala | 6 +-----
src/baobab-window.vala | 6 +++---
2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/src/baobab-chart.vala b/src/baobab-chart.vala
index 4c0e24c..f27f610 100644
--- a/src/baobab-chart.vala
+++ b/src/baobab-chart.vala
@@ -599,11 +599,7 @@ namespace Baobab {
action = action_group.lookup_action ("zoom-out") as SimpleAction;
action.set_enabled (can_zoom_out ());
- if (event != null) {
- context_menu.popup (null, null, null, event.button, event.time);
- } else {
- context_menu.popup (null, null, null, 0, Gtk.get_current_event_time ());
- }
+ context_menu.popup_at_pointer (event);
}
void connect_model_signals (Gtk.TreeModel m) {
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index 836a414..5d6c412 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -363,12 +363,12 @@ namespace Baobab {
bool show_treeview_popup (Gtk.Menu popup, Gdk.EventButton? event) {
if (event != null) {
- popup.popup (null, null, null, event.button, event.time);
+ popup.popup_at_pointer (event);
} else {
- popup.popup (null, null, null, 0, Gtk.get_current_event_time ());
+ popup.popup_at_widget (treeview, Gdk.Gravity.CENTER, Gdk.Gravity.CENTER);
popup.select_first (false);
}
- return true;
+ return Gdk.EVENT_STOP;
}
public void open_item (Gtk.TreeIter iter) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]