mirror of
https://github.com/veracrypt/VeraCrypt.git
synced 2025-11-11 11:08:02 -06:00
MacOSX: Ensure that main window is visible on screen when About is display as a way to workaround for situations where UI is not visible or can't be move (for example, when changing display monitor with a different resolution).
This commit is contained in:
@@ -725,6 +725,7 @@ namespace VeraCrypt
|
|||||||
#ifdef TC_MACOSX
|
#ifdef TC_MACOSX
|
||||||
if (Gui->IsInBackgroundMode())
|
if (Gui->IsInBackgroundMode())
|
||||||
Gui->SetBackgroundMode (false);
|
Gui->SetBackgroundMode (false);
|
||||||
|
EnsureVisible ();
|
||||||
#endif
|
#endif
|
||||||
AboutDialog dialog (this);
|
AboutDialog dialog (this);
|
||||||
dialog.ShowModal();
|
dialog.ShowModal();
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
|
|
||||||
#include "Forms.h"
|
#include "Forms.h"
|
||||||
#include "ChangePasswordDialog.h"
|
#include "ChangePasswordDialog.h"
|
||||||
|
#include <wx/display.h>
|
||||||
|
|
||||||
namespace VeraCrypt
|
namespace VeraCrypt
|
||||||
{
|
{
|
||||||
@@ -162,6 +163,26 @@ namespace VeraCrypt
|
|||||||
void UpdateWipeCacheButton ();
|
void UpdateWipeCacheButton ();
|
||||||
void WipeCache ();
|
void WipeCache ();
|
||||||
|
|
||||||
|
void EnsureVisible()
|
||||||
|
{
|
||||||
|
wxDisplay display (this);
|
||||||
|
wxRect displayRect = display.GetClientArea();
|
||||||
|
|
||||||
|
bool bMove = false;
|
||||||
|
wxPoint p = GetScreenPosition();
|
||||||
|
wxRect r = GetRect ();
|
||||||
|
if (p.x < displayRect.x)
|
||||||
|
p.x = 0, bMove = true;
|
||||||
|
if (p.y < displayRect.y)
|
||||||
|
p.y = displayRect.y, bMove = true;
|
||||||
|
if (p.x + r.width > displayRect.x + displayRect.width)
|
||||||
|
p.x = displayRect.x + displayRect.width - r.width, bMove = true;
|
||||||
|
if (p.y + r.height > displayRect.y + displayRect.height)
|
||||||
|
p.y = displayRect.y + displayRect.height - r.height, bMove = true;
|
||||||
|
if (bMove)
|
||||||
|
Move (p);
|
||||||
|
}
|
||||||
|
|
||||||
struct VolumeActivityMapEntry
|
struct VolumeActivityMapEntry
|
||||||
{
|
{
|
||||||
VolumeActivityMapEntry () { }
|
VolumeActivityMapEntry () { }
|
||||||
|
|||||||
Reference in New Issue
Block a user