mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
Minor tweaks to fullscreen in linux, and make FullScr button in GUI work.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5074 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
@ -148,7 +148,14 @@ void *GetWindowHandle()
|
||||
{
|
||||
return g_pWindowHandle;
|
||||
}
|
||||
|
||||
|
||||
#if defined HAVE_X11 && HAVE_X11
|
||||
void *GetXWindow()
|
||||
{
|
||||
return g_pXWindow;
|
||||
}
|
||||
#endif
|
||||
|
||||
bool GetRealWiimote()
|
||||
{
|
||||
return g_bRealWiimote;
|
||||
|
@ -59,6 +59,9 @@ namespace Core
|
||||
extern SCoreStartupParameter g_CoreStartupParameter;
|
||||
|
||||
void* GetWindowHandle();
|
||||
#if defined HAVE_X11 && HAVE_X11
|
||||
void* GetXWindow();
|
||||
#endif
|
||||
bool GetRealWiimote();
|
||||
|
||||
extern bool bReadTrace;
|
||||
|
@ -50,6 +50,10 @@
|
||||
|
||||
#include <wx/datetime.h> // wxWidgets
|
||||
|
||||
#if defined HAVE_X11 && HAVE_X11
|
||||
#include <X11/Xlib.h>
|
||||
#endif
|
||||
|
||||
// Resources
|
||||
|
||||
extern "C" {
|
||||
@ -906,9 +910,32 @@ wxAuiNotebook* CFrame::CreateEmptyNotebook()
|
||||
return NB;
|
||||
}
|
||||
|
||||
#if defined HAVE_X11 && HAVE_X11
|
||||
void X11_ShowFullScreen(bool bF)
|
||||
{
|
||||
XEvent event;
|
||||
Display *dpy = (Display *)Core::GetWindowHandle();
|
||||
Window win = *(Window *)Core::GetXWindow();
|
||||
|
||||
// Init X event structure for TOGGLE_FULLSCREEN client message
|
||||
event.xclient.type = ClientMessage;
|
||||
event.xclient.format = 32;
|
||||
event.xclient.data.l[0] = XInternAtom(dpy, "TOGGLE_FULLSCREEN", False);;
|
||||
|
||||
// Send the event
|
||||
if (!XSendEvent(dpy, win, False, False, &event))
|
||||
{
|
||||
ERROR_LOG(VIDEO, "Failed to switch fullscreen/windowed mode.\n");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
void CFrame::DoFullscreen(bool bF)
|
||||
{
|
||||
#if defined HAVE_X11 && HAVE_X11
|
||||
if ((Core::GetState() == Core::CORE_RUN) && !m_bModalDialogOpen)
|
||||
X11_ShowFullScreen(bF);
|
||||
#endif
|
||||
// Only switch this to fullscreen if we're rendering to main AND if we're running a game
|
||||
// plus if a modal dialog is open, this will still process the keyboard events, and may cause
|
||||
// the main window to become unresponsive, so we have to avoid that.
|
||||
|
Reference in New Issue
Block a user