summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorinfirit <[email protected]>2014-02-12 19:17:18 +0100
committerinfirit <[email protected]>2014-02-12 19:19:17 +0100
commit8ec90b7ca85664810aecd9a9c6c326d207b4dafd (patch)
treee90b5dfac577111e598ad3d681bdf8c3a495c9a3
parentc3b48ea39ab358b45048e300deafaa3f569748ad (diff)
downloadmate-applets-8ec90b7ca85664810aecd9a9c6c326d207b4dafd.tar.bz2
mate-applets-8ec90b7ca85664810aecd9a9c6c326d207b4dafd.tar.xz
invest-applet:Fix gtk2 applet.
-rw-r--r--invest-applet/invest/applet.py21
1 files changed, 15 insertions, 6 deletions
diff --git a/invest-applet/invest/applet.py b/invest-applet/invest/applet.py
index 33f11916..4a0b83ce 100644
--- a/invest-applet/invest/applet.py
+++ b/invest-applet/invest/applet.py
@@ -131,16 +131,25 @@ class InvestmentsListWindow(Gtk.Window):
"""
self.realize()
- window = self.applet.get_window()
- screen = window.get_screen()
- monitor = screen.get_monitor_geometry (screen.get_monitor_at_window (window))
-
# Get our own dimensions & position
#(wx, wy) = self.get_origin()
- (ret, ax, ay) = window.get_origin()
+
+ window = self.applet.get_window()
+ if GTK_API_VERSION == '3.0':
+ screen = window.get_screen()
+ monitor = screen.get_monitor_geometry (screen.get_monitor_at_window (window))
+ (ret, ax, ay) = window.get_origin()
+ (aw, ah) = self.applet.window.get_size ()
+ (ignored, ignored, aw, ah) = window.get_geometry()
+ else:
+ screen = self.applet.get_screen()
+ monitor = Gdk.Rectangle(0, 0, 0, 0)
+ ax = ay = 0
+ self.applet.window.get_origin(ax, ay)
+ (aw, ah) = self.applet.window.get_size ()
+ screen.get_monitor_geometry (screen.get_monitor_at_window (self.applet.window), monitor)
(ww, wh) = self.get_size()
- (ignored, ignored, aw, ah) = window.get_geometry()
if self.alignment == MatePanelApplet.AppletOrient.LEFT:
x = ax - ww