Skip to content

Commit bbef9ca

Browse files
owmtiaDavid Guest
andauthored
Fixed regression in dbus NewNote with start position (#143)
Co-authored-by: David Guest <dguest@cdscc.nasa.gov>
1 parent 729cc39 commit bbef9ca

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

usr/lib/sticky/sticky.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,8 @@ def dbus_method_callback(self, connection, sender, path, iface_name, method_name
830830
self.activate_notes(0)
831831

832832
elif method_name == 'NewNote':
833-
x, y = self.find_note_location(40, 40)
833+
x, y, direction = self.get_direction()
834+
x, y = self.find_note_location(x, y, direction)
834835

835836
self.add_note({'text': params.unpack()[0], 'x': x, 'y': y})
836837

@@ -1002,7 +1003,7 @@ def find_note_location(self, x, y, direction):
10021003

10031004
return x, y
10041005

1005-
def new_note(self, button=None, parent=None):
1006+
def get_direction(self, parent=None):
10061007
workarea_rect = Gdk.Monitor.get_workarea(
10071008
Gdk.Display.get_primary_monitor(Gdk.Display.get_default())
10081009
)
@@ -1034,6 +1035,11 @@ def new_note(self, button=None, parent=None):
10341035
y = workarea_rect.height / 2 - self.settings.get_uint('default-height') / 2
10351036
else:
10361037
y = 20
1038+
1039+
return (x, y, direction)
1040+
1041+
def new_note(self, button=None, parent=None):
1042+
x, y, direction = self.get_direction(parent)
10371043

10381044
x, y = self.find_note_location(x, y, direction)
10391045

0 commit comments

Comments
 (0)