diff options
author | Gary E. Miller <gem@rellim.com> | 2018-09-29 18:07:32 -0700 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2018-09-29 18:07:32 -0700 |
commit | 888aff677a7ef40d2241caa6cfd9cbbada411122 (patch) | |
tree | 4524063e6b8c4eff58a47e199363101aa0128381 | |
parent | e7819cbed3b04a047d3b264166da385c3bc41b33 (diff) | |
download | gpsd-888aff677a7ef40d2241caa6cfd9cbbada411122.tar.gz |
xgps: slightly nicer mouse over behavior.
Modal was locking the popup for the timeout duration.
-rwxr-xr-x | xgps | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -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) |