[gnome-maps/wip/mlundblad/unparent-bubbles] WIP: mapMarker: Unparent bubble when marker is unmapped
- From: Marcus Lundblad <mlundblad src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-maps/wip/mlundblad/unparent-bubbles] WIP: mapMarker: Unparent bubble when marker is unmapped
- Date: Sat, 3 Sep 2022 08:17:02 +0000 (UTC)
commit 6f0eacd48e58135033d8102d1a4f557e7a428a37
Author: Marcus Lundblad <ml dfupdate se>
Date: Sat Sep 3 10:15:57 2022 +0200
WIP: mapMarker: Unparent bubble when marker is unmapped
src/mapMarker.js | 19 ++++++++++++++-----
1 file changed, 14 insertions(+), 5 deletions(-)
---
diff --git a/src/mapMarker.js b/src/mapMarker.js
index 91cd5688..7b592978 100644
--- a/src/mapMarker.js
+++ b/src/mapMarker.js
@@ -53,6 +53,11 @@ export class MapMarker extends Shumate.Marker {
this._image = new Gtk.Image({ icon_size: Gtk.IconSize.NORMAL });
this.child = this._image;
+ this.connect('unmap', () => {
+ if (this._bubble)
+ this._bubble.unparent();
+ });
+
if (this._mapView) {
this._viewport = this._mapView.map.viewport;
@@ -126,12 +131,16 @@ export class MapMarker extends Shumate.Marker {
}
get bubble() {
- if (this._bubble === undefined && this._hasBubble()) {
- if (this._place.name) {
- this._bubble = new MapBubble({ place: this._place,
- mapView: this._mapView });
- this._bubble.set_parent(this._mapView);
+ if (this._hasBubble) {
+ if (this._bubble === undefined) {
+ if (this._place.name) {
+ this._bubble = new MapBubble({ place: this._place,
+ mapView: this._mapView });
+ }
}
+
+ if (!this._bubble.get_parent())
+ this._bubble.set_parent(this._mapView);
}
return this._bubble;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]