[gnome-shell] popupMenu: Don't chain up vfuncs if the parent doesn't implement them
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] popupMenu: Don't chain up vfuncs if the parent doesn't implement them
- Date: Mon, 28 Oct 2019 13:49:35 +0000 (UTC)
commit c35b4cede58142797b1f6b04a4e2e7eaa938234a
Author: Jonas Dreßler <verdre v0yd nl>
Date: Sun Oct 27 22:28:38 2019 +0100
popupMenu: Don't chain up vfuncs if the parent doesn't implement them
Some vfuncs like `button_press_event`, `button_release_event` and
`touch_event` don't have handlers in the parent classes of
PopupBaseMenuItem. So don't call those handlers and return the default
Clutter.EVENT_PROPAGATE there.
This fixes a crash of the shell that happens when pressing a mouse
button inside the system popup menu and releasing it above a slider like
the volume slider again.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/787
js/ui/popupMenu.js | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/js/ui/popupMenu.js b/js/ui/popupMenu.js
index 062b2bf9e0..fb954cda17 100644
--- a/js/ui/popupMenu.js
+++ b/js/ui/popupMenu.js
@@ -118,18 +118,18 @@ var PopupBaseMenuItem = GObject.registerClass({
this._parent = parent;
}
- vfunc_button_press_event(buttonEvent) {
+ vfunc_button_press_event() {
if (!this._activatable)
- return super.vfunc_button_press_event(buttonEvent);
+ return Clutter.EVENT_PROPAGATE;
// This is the CSS active state
this.add_style_pseudo_class('active');
return Clutter.EVENT_PROPAGATE;
}
- vfunc_button_release_event(buttonEvent) {
+ vfunc_button_release_event() {
if (!this._activatable)
- return super.vfunc_button_release_event(buttonEvent);
+ return Clutter.EVENT_PROPAGATE;
this.remove_style_pseudo_class('active');
this.activate(Clutter.get_current_event());
@@ -138,7 +138,7 @@ var PopupBaseMenuItem = GObject.registerClass({
vfunc_touch_event(touchEvent) {
if (!this._activatable)
- return super.vfunc_touch_event(touchEvent);
+ return Clutter.EVENT_PROPAGATE;
if (touchEvent.type == Clutter.EventType.TOUCH_END) {
this.remove_style_pseudo_class('active');
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]