This repository was archived by the owner on Jul 24, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +36
-2
lines changed Expand file tree Collapse file tree 5 files changed +36
-2
lines changed Original file line number Diff line number Diff line change 1+ # [ 1.0.1]
2+ ###### 2016-09-09
3+
4+ A tiny patch release which eliminates two bugs. π
5+
6+ ###### Fixed
7+ - Calendar window position being offset on multiple monitors
8+ - Preferences and about window being opened multiple times
9+
10+ # 1.0.0
11+ ###### 2016-09-04
12+
13+ First public release! π
14+
15+ [ 1.0.1 ] : https://github.com/mzdr/timestamp/compare/1.0.0...1.0.1
Original file line number Diff line number Diff line change @@ -23,6 +23,13 @@ class About
2323 */
2424 show ( )
2525 {
26+ // Don't create multiple windows, focus on last created one instead
27+ if ( this . _window && this . _window . isDestroyed ( ) === false ) {
28+ this . _window . show ( ) ;
29+
30+ return ;
31+ }
32+
2633 // Create window instance
2734 this . _window = new Electron . BrowserWindow ( {
2835 resizable : false ,
Original file line number Diff line number Diff line change @@ -70,8 +70,13 @@ class App
7070 // Show calendar when clicking on tray icon
7171 this . tray . onClick ( ( ) => {
7272 const bounds = this . tray . getBounds ( ) ;
73+ const currentMousePosition = Electron . screen . getCursorScreenPoint ( ) ;
74+ const currentDisplay = Electron . screen . getDisplayNearestPoint ( currentMousePosition ) ;
7375
74- this . calendar . setPosition ( bounds . x + bounds . width / 2 , 0 ) ;
76+ this . calendar . setPosition (
77+ bounds . x + bounds . width / 2 ,
78+ currentDisplay . workArea . y
79+ ) ;
7580
7681 if ( this . calendar . isVisible ( ) ) {
7782 this . calendar . hide ( ) ;
Original file line number Diff line number Diff line change 22 "name" : " timestamp" ,
33 "productName" : " Timestamp" ,
44 "description" : " A better macOS menu bar clock with a customizable date/time display and a calendar." ,
5- "version" : " 1.0.0 " ,
5+ "version" : " 1.0.1 " ,
66 "author" : " Sebastian Prein <hi@sebastianprein.com>" ,
77 "copyright" : " Β© 2016 Sebastian Prein" ,
88 "homepage" : " https://github.com/mzdr/timestamp" ,
Original file line number Diff line number Diff line change @@ -46,6 +46,13 @@ class Preferences
4646 */
4747 show ( )
4848 {
49+ // Don't create multiple windows, focus on last created one instead
50+ if ( this . _window && this . _window . isDestroyed ( ) === false ) {
51+ this . _window . show ( ) ;
52+
53+ return ;
54+ }
55+
4956 // Create window instance
5057 this . _window = new Electron . BrowserWindow ( {
5158 resizable : false ,
You canβt perform that action at this time.
0 commit comments