~jconti/recent-notifications/trunk

« back to all changes in this revision

Viewing changes to recent_notifications/MessageWindow.py

  • Committer: Jason Conti
  • Date: 2011-03-09 18:50:12 UTC
  • Revision ID: jason.conti@gmail.com-20110309185012-12jjwg987m305061
It seems my broken window manager ignores gravity settings, so I never noticed that they were incorrect. This seems to result in incorrect positioning on people with working window managers (that don't ignore the gravity). Removed the gravity calculations from align_with_parent, and assuming everything is calculated from GRAVITY_NORTH_WEST. Still works here, hope it fixes the issue.

Show diffs side-by-side

added added

removed removed

Lines of Context:
194
194
      if (y + h) > monitor.y + monitor.height:
195
195
        y -= (y + h) - (monitor.y + monitor.height)
196
196
 
197
 
      if (y + h) > (monitor.height / 2):
198
 
        gravity = gtk.gdk.GRAVITY_SOUTH_WEST
199
 
      else:
200
 
        gravity = gtk.gdk.GRAVITY_NORTH_WEST
201
 
 
202
197
    elif orient == gnomeapplet.ORIENT_LEFT: # Panel on right
203
198
      x -= w
204
199
      if (y + h) > monitor.y + monitor.height:
205
200
        y -= (y + h) - (monitor.y + monitor.height)
206
201
 
207
 
      if (y + h) > (monitor.height / 2):
208
 
        gravity = gtk.gdk.GRAVITY_SOUTH_EAST
209
 
      else:
210
 
        gravity = gtk.gdk.GRAVITY_NORTH_EAST
211
 
 
212
202
    elif orient == gnomeapplet.ORIENT_DOWN: # Panel on top
213
203
      y += button_h
214
204
      if (x + w) > monitor.x + monitor.width:
215
205
        x -= (x + w) - (monitor.x + monitor.width)
216
206
 
217
 
      gravity = gtk.gdk.GRAVITY_NORTH_WEST
218
 
 
219
207
    else: # Panel on bottom
220
208
      y -= h
221
209
      if (x + w) > monitor.x + monitor.width:
222
210
        x -= (x + w) - (monitor.x + monitor.width)
223
211
 
224
 
      gravity = gtk.gdk.GRAVITY_SOUTH_WEST
 
212
    gravity = gtk.gdk.GRAVITY_NORTH_WEST
225
213
 
226
214
    self.set_gravity(gravity)
227
215
    self.move(x, y)