summaryrefslogtreecommitdiff
path: root/xgpsspeed
diff options
context:
space:
mode:
authorFred Wright <fw@fwright.net>2016-04-08 10:07:47 -0700
committerEric S. Raymond <esr@thyrsus.com>2016-04-09 04:39:16 -0400
commit1edf5d2a7490ec7c1ee0f7ac8a77f30dcea82d03 (patch)
tree2cdcbe95bb0304095e8af7aee1eb8b798be78d88 /xgpsspeed
parentdb33488b20d15506eac5ad033b687cc90f8edd69 (diff)
downloadgpsd-1edf5d2a7490ec7c1ee0f7ac8a77f30dcea82d03.tar.gz
Fixes Gtk warnings related to xgps/xgpsspeed error boxes.
The Gtk MessageDialog function gives a warning if no parent window is specified. Since the main window already exists in those cases, it's simply a matter of passing the extra argument to MessageDialog. This has the side effect of changing the position of the dialog box, such that it's centered over the parent window rather than being near its upper left-hand corner. In the xgps case, it appears to be centered over whichever subwindow was most recently updated. TESTED: Verified that both the gpsd not running and gpsd stopped running cases no longer produce warning messages on the terminal.
Diffstat (limited to 'xgpsspeed')
-rwxr-xr-xxgpsspeed2
1 files changed, 2 insertions, 0 deletions
diff --git a/xgpsspeed b/xgpsspeed
index 1a47b3e8..b0dda092 100755
--- a/xgpsspeed
+++ b/xgpsspeed
@@ -608,6 +608,7 @@ class Main(object):
def handle_hangup(self, _dummy, _unused):
w = Gtk.MessageDialog(
+ parent=self.window,
type=Gtk.MessageType.ERROR,
flags=Gtk.DialogFlags.DESTROY_WITH_PARENT,
buttons=Gtk.ButtonsType.OK
@@ -653,6 +654,7 @@ class Main(object):
Gtk.main()
except SocketError:
w = Gtk.MessageDialog(
+ parent=self.window,
type=Gtk.MessageType.ERROR,
flags=Gtk.DialogFlags.DESTROY_WITH_PARENT,
buttons=Gtk.ButtonsType.OK