summaryrefslogtreecommitdiff
path: root/xgps
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2018-09-29 18:07:32 -0700
committerGary E. Miller <gem@rellim.com>2018-09-29 18:07:32 -0700
commit888aff677a7ef40d2241caa6cfd9cbbada411122 (patch)
tree4524063e6b8c4eff58a47e199363101aa0128381 /xgps
parente7819cbed3b04a047d3b264166da385c3bc41b33 (diff)
downloadgpsd-888aff677a7ef40d2241caa6cfd9cbbada411122.tar.gz
xgps: slightly nicer mouse over behavior.
Modal was locking the popup for the timeout duration.
Diffstat (limited to 'xgps')
-rwxr-xr-xxgps16
1 files changed, 16 insertions, 0 deletions
diff --git a/xgps b/xgps
index a35ec4a2..285a28ff 100755
--- a/xgps
+++ b/xgps
@@ -176,20 +176,35 @@ class SkyView(Gtk.DrawingArea):
self.rotate = rotation
self.connect('motion_notify_event', self.popup)
self.popover = None
+ self.pop_xy = (None, None)
def popdown(self):
"See if need to popdown the sat details"
if self.popover:
self.popover.popdown()
self.popover = None
+ self.pop_xy = (None, None)
def popup(self, skyview, event):
"See if need to popup the sat details"
for (x, y, sat) in self.sat_xy:
if ((SkyView.SAT_RADIUS >= abs(x - event.x) and
SkyView.SAT_RADIUS >= abs(y - event.y))):
+ # got a sat match under the mouse
# print((x, y))
+ if ((self.pop_xy[0] and self.pop_xy[1] and
+ self.pop_xy == (int(x), int(y)))):
+ # popup already up here, ignore event
+ # print("(%d, %d)" % (x, y))
+ return
+
+ if self.popover:
+ # remove any old, no longer current popup
+ # this never happens?
+ self.popdown()
+
# mouse is over a satellite, do popup
+ self.pop_xy = (int(x), int(y))
self.popover = Gtk.Popover()
constellation = gnssid_str(sat.gnssid, sat.svid)
s = ("PRN %d\n"
@@ -206,6 +221,7 @@ class SkyView(Gtk.DrawingArea):
rectangle.y = y - 25
rectangle.width = 50
rectangle.height = 50
+ self.popover.set_modal(False)
self.popover.set_relative_to(self)
self.popover.set_position(Gtk.PositionType.TOP)
self.popover.set_pointing_to(rectangle)