diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Main/Forms/MainFrame.cpp | 1 | ||||
-rw-r--r-- | src/Main/Forms/MainFrame.h | 21 |
2 files changed, 22 insertions, 0 deletions
diff --git a/src/Main/Forms/MainFrame.cpp b/src/Main/Forms/MainFrame.cpp index 9abe2552..8e0c401b 100644 --- a/src/Main/Forms/MainFrame.cpp +++ b/src/Main/Forms/MainFrame.cpp | |||
@@ -725,6 +725,7 @@ namespace VeraCrypt | |||
725 | #ifdef TC_MACOSX | 725 | #ifdef TC_MACOSX |
726 | if (Gui->IsInBackgroundMode()) | 726 | if (Gui->IsInBackgroundMode()) |
727 | Gui->SetBackgroundMode (false); | 727 | Gui->SetBackgroundMode (false); |
728 | EnsureVisible (); | ||
728 | #endif | 729 | #endif |
729 | AboutDialog dialog (this); | 730 | AboutDialog dialog (this); |
730 | dialog.ShowModal(); | 731 | dialog.ShowModal(); |
diff --git a/src/Main/Forms/MainFrame.h b/src/Main/Forms/MainFrame.h index 39c411ad..b8991b73 100644 --- a/src/Main/Forms/MainFrame.h +++ b/src/Main/Forms/MainFrame.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include "Forms.h" | 16 | #include "Forms.h" |
17 | #include "ChangePasswordDialog.h" | 17 | #include "ChangePasswordDialog.h" |
18 | #include <wx/display.h> | ||
18 | 19 | ||
19 | namespace VeraCrypt | 20 | namespace VeraCrypt |
20 | { | 21 | { |
@@ -161,6 +162,26 @@ namespace VeraCrypt | |||
161 | void UpdateVolumeList (); | 162 | void UpdateVolumeList (); |
162 | void UpdateWipeCacheButton (); | 163 | void UpdateWipeCacheButton (); |
163 | void WipeCache (); | 164 | void WipeCache (); |
165 | |||
166 | void EnsureVisible() | ||
167 | { | ||
168 | wxDisplay display (this); | ||
169 | wxRect displayRect = display.GetClientArea(); | ||
170 | |||
171 | bool bMove = false; | ||
172 | wxPoint p = GetScreenPosition(); | ||
173 | wxRect r = GetRect (); | ||
174 | if (p.x < displayRect.x) | ||
175 | p.x = 0, bMove = true; | ||
176 | if (p.y < displayRect.y) | ||
177 | p.y = displayRect.y, bMove = true; | ||
178 | if (p.x + r.width > displayRect.x + displayRect.width) | ||
179 | p.x = displayRect.x + displayRect.width - r.width, bMove = true; | ||
180 | if (p.y + r.height > displayRect.y + displayRect.height) | ||
181 | p.y = displayRect.y + displayRect.height - r.height, bMove = true; | ||
182 | if (bMove) | ||
183 | Move (p); | ||
184 | } | ||
164 | 185 | ||
165 | struct VolumeActivityMapEntry | 186 | struct VolumeActivityMapEntry |
166 | { | 187 | { |