Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Revert "support retina display"
This reverts commit 3aa9901.
  • Loading branch information
Parlane committed Dec 23, 2012
1 parent 59ec1fe commit eedca57
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 111 deletions.
2 changes: 1 addition & 1 deletion Source/Core/DolphinWX/Src/Debugger/DSPDebugWindow.h
Expand Up @@ -50,7 +50,7 @@ class DSPDebuggerLLE : public wxPanel
DSPDebuggerLLE(wxWindow *parent, wxWindowID id = wxID_ANY);
virtual ~DSPDebuggerLLE();

virtual void Update();
void Update();

private:
DECLARE_EVENT_TABLE();
Expand Down
37 changes: 3 additions & 34 deletions Source/Core/DolphinWX/Src/Frame.cpp
Expand Up @@ -450,26 +450,11 @@ CFrame::~CFrame()

bool CFrame::RendererIsFullscreen()
{
bool fullscreen = false;

if (Core::GetState() == Core::CORE_RUN || Core::GetState() == Core::CORE_PAUSE)
{
fullscreen = m_RenderFrame->IsFullScreen();
}

#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
if (m_RenderFrame != NULL)
{
NSView *view = (NSView *) m_RenderFrame->GetHandle();
NSWindow *window = [view window];

if ([window respondsToSelector:@selector(toggleFullScreen:)]) {
fullscreen = (([window styleMask] & NSFullScreenWindowMask) == NSFullScreenWindowMask);
}
return m_RenderFrame->IsFullScreen();
}
#endif

return fullscreen;
return false;
}

void CFrame::OnQuit(wxCommandEvent& WXUNUSED (event))
Expand Down Expand Up @@ -1017,23 +1002,7 @@ void CFrame::DoFullscreen(bool bF)
{
ToggleDisplayMode(bF);

#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *view = (NSView *) m_RenderFrame->GetHandle();
NSWindow *window = [view window];

if ([window respondsToSelector:@selector(toggleFullScreen:)])
{
if (bF != RendererIsFullscreen())
{
[window toggleFullScreen:nil];
}
}
else
#endif
{
m_RenderFrame->ShowFullScreen(bF, wxFULLSCREEN_ALL);
}

m_RenderFrame->ShowFullScreen(bF, wxFULLSCREEN_ALL);
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
{
if (bF)
Expand Down
4 changes: 0 additions & 4 deletions Source/Core/DolphinWX/Src/Frame.h
Expand Up @@ -29,10 +29,6 @@
#include <string>
#include <vector>

#ifdef __APPLE__
#include <Cocoa/Cocoa.h>
#endif

#include "CDUtils.h"
#include "Debugger/CodeWindow.h"
#include "LogWindow.h"
Expand Down
90 changes: 30 additions & 60 deletions Source/Core/DolphinWX/Src/FrameTools.cpp
Expand Up @@ -876,46 +876,39 @@ void CFrame::ToggleDisplayMode(bool bFullscreen)
#elif defined(HAVE_XRANDR) && HAVE_XRANDR
m_XRRConfig->ToggleDisplayMode(bFullscreen);
#elif defined __APPLE__
#if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *view = (NSView *) m_RenderFrame->GetHandle();
NSWindow *window = [view window];
if (!bFullscreen) {
CGRestorePermanentDisplayConfiguration();
CGDisplayRelease(CGMainDisplayID());
return;
}

if (![window respondsToSelector:@selector(toggleFullScreen:)])
#endif
CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID());
for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
{
if (!bFullscreen) {
CGRestorePermanentDisplayConfiguration();
CGDisplayRelease(CGMainDisplayID());
return;
}

CFArrayRef modes = CGDisplayAvailableModes(CGMainDisplayID());
for (CFIndex i = 0; i < CFArrayGetCount(modes); i++)
{
CFDictionaryRef mode;
CFNumberRef ref;
int x, y, w, h, d;

sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.\
strFullscreenResolution.c_str(), "%dx%d", &x, &y);

mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayWidth);
CFNumberGetValue(ref, kCFNumberIntType, &w);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayHeight);
CFNumberGetValue(ref, kCFNumberIntType, &h);
ref = (CFNumberRef)CFDictionaryGetValue(mode,
kCGDisplayBitsPerPixel);
CFNumberGetValue(ref, kCFNumberIntType, &d);

if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched))
continue;
if (w != x || h != y || d != 32)
continue;;

CGDisplaySwitchToMode(CGMainDisplayID(), mode);
}
CFDictionaryRef mode;
CFNumberRef ref;
int x, y, w, h, d;

sscanf(SConfig::GetInstance().m_LocalCoreStartupParameter.\
strFullscreenResolution.c_str(), "%dx%d", &x, &y);

mode = (CFDictionaryRef)CFArrayGetValueAtIndex(modes, i);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayWidth);
CFNumberGetValue(ref, kCFNumberIntType, &w);
ref = (CFNumberRef)CFDictionaryGetValue(mode, kCGDisplayHeight);
CFNumberGetValue(ref, kCFNumberIntType, &h);
ref = (CFNumberRef)CFDictionaryGetValue(mode,
kCGDisplayBitsPerPixel);
CFNumberGetValue(ref, kCFNumberIntType, &d);

if (CFDictionaryContainsKey(mode, kCGDisplayModeIsStretched))
continue;
if (w != x || h != y || d != 32)
continue;;

CGDisplaySwitchToMode(CGMainDisplayID(), mode);
}

#endif
}

Expand Down Expand Up @@ -975,14 +968,6 @@ void CFrame::StartGame(const std::string& filename)
m_RenderFrame->Show();
}

#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *view = (NSView *) m_RenderFrame->GetHandle();
NSWindow *window = [view window];

if ([window respondsToSelector:@selector(setCollectionBehavior:)])
[window setCollectionBehavior:NSWindowCollectionBehaviorFullScreenPrimary];
#endif

wxBeginBusyCursor();

DoFullscreen(SConfig::GetInstance().m_LocalCoreStartupParameter.bFullscreen);
Expand Down Expand Up @@ -1155,23 +1140,8 @@ void CFrame::DoStop()
if (SConfig::GetInstance().m_LocalCoreStartupParameter.bHideCursor)
m_RenderParent->SetCursor(wxNullCursor);
DoFullscreen(false);

if (!SConfig::GetInstance().m_LocalCoreStartupParameter.bRenderToMain)
{
m_RenderFrame->Destroy();
}
#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
else
{
// Disable the full screen button when not in a game.
NSView *view = (NSView *) m_RenderFrame->GetHandle();
NSWindow *window = [view window];

if ([window respondsToSelector:@selector(setCollectionBehavior:)])
[window setCollectionBehavior:NSWindowCollectionBehaviorDefault];
}
#endif

m_RenderParent = NULL;

// Clean framerate indications from the status bar.
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinWX/Src/TASInputDlg.cpp
Expand Up @@ -680,7 +680,7 @@ void TASInputDlg::OnCloseWindow(wxCloseEvent& event)
}
}

bool TASInputDlg::HasFocus() const
bool TASInputDlg::HasFocus()
{
//allows numbers to be used as hotkeys
if(TextBoxHasFocus())
Expand All @@ -695,7 +695,7 @@ bool TASInputDlg::HasFocus() const
return false;
}

bool TASInputDlg::TextBoxHasFocus() const
bool TASInputDlg::TextBoxHasFocus()
{
if(wxWindow::FindFocus() == wx_mainX_t)
return true;
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/DolphinWX/Src/TASInputDlg.h
Expand Up @@ -45,8 +45,8 @@ class TASInputDlg : public wxDialog
void SetTurboFalse(wxMouseEvent& event);
void ButtonTurbo();
void GetKeyBoardInput(SPADStatus *PadStatus);
virtual bool TextBoxHasFocus() const;
virtual bool HasFocus() const;
bool TextBoxHasFocus();
bool HasFocus();

wxBitmap CreateStickBitmap(int x, int y);

Expand Down
8 changes: 0 additions & 8 deletions Source/Core/DolphinWX/Src/VideoConfigDiag.cpp
Expand Up @@ -252,14 +252,6 @@ VideoConfigDiag::VideoConfigDiag(wxWindow* parent, const std::string &title, con
wxFlexGridSizer* const szr_display = new wxFlexGridSizer(2, 5, 5);

{

#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7
NSView *view = (NSView *) parent->GetHandle();
NSWindow *window = [view window];

if (![window respondsToSelector:@selector(toggleFullScreen:)])
#endif

// display resolution
{
wxArrayString res_list = GetListOfResolutions();
Expand Down

0 comments on commit eedca57

Please sign in to comment.