mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-06-01 22:00:25 +00:00
Working on fullscreen support.
This commit is contained in:
parent
3b9dbd1209
commit
d2cde0ddf0
|
@ -233,8 +233,17 @@ namespace OpenTK.Platform.X11
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
if (value && !fullscreen || !value && fullscreen)
|
if (value && !fullscreen)
|
||||||
{
|
{
|
||||||
|
Debug.Print("Going fullscreen");
|
||||||
|
Debug.Indent();
|
||||||
|
DisableWindowDecorations();
|
||||||
|
Debug.Unindent();
|
||||||
|
fullscreen = true;
|
||||||
|
}
|
||||||
|
//else (!value && fullscreen)
|
||||||
|
{
|
||||||
|
/*
|
||||||
Debug.Print(value ? "Going fullscreen" : "Going windowed");
|
Debug.Print(value ? "Going fullscreen" : "Going windowed");
|
||||||
IntPtr state_atom = Functions.XInternAtom(API.DefaultDisplay, "_NET_WM_STATE", false);
|
IntPtr state_atom = Functions.XInternAtom(API.DefaultDisplay, "_NET_WM_STATE", false);
|
||||||
IntPtr fullscreen_atom = Functions.XInternAtom(API.DefaultDisplay, "_NET_WM_STATE_FULLSCREEN", false);
|
IntPtr fullscreen_atom = Functions.XInternAtom(API.DefaultDisplay, "_NET_WM_STATE_FULLSCREEN", false);
|
||||||
|
@ -252,6 +261,7 @@ namespace OpenTK.Platform.X11
|
||||||
(IntPtr)(EventMask.SubstructureRedirectMask | EventMask.SubstructureNotifyMask), ref xev);
|
(IntPtr)(EventMask.SubstructureRedirectMask | EventMask.SubstructureNotifyMask), ref xev);
|
||||||
|
|
||||||
fullscreen = !fullscreen;
|
fullscreen = !fullscreen;
|
||||||
|
*/
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -660,5 +670,35 @@ namespace OpenTK.Platform.X11
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
#region --- Private Methods ---
|
||||||
|
|
||||||
|
#region void DisableWindowDecorations()
|
||||||
|
|
||||||
|
void DisableWindowDecorations()
|
||||||
|
{
|
||||||
|
Debug.Print("Removing decorations.");
|
||||||
|
Debug.Indent();
|
||||||
|
if (DisableMotifDecorations()) Debug.Print("Removed decorations through motif.");
|
||||||
|
Debug.Unindent();
|
||||||
|
}
|
||||||
|
|
||||||
|
bool DisableMotifDecorations()
|
||||||
|
{
|
||||||
|
IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_MOTIF_WM_HINTS", true);
|
||||||
|
if (atom != IntPtr.Zero)
|
||||||
|
{
|
||||||
|
MotifWmHints hints = new MotifWmHints();
|
||||||
|
hints.flags = (IntPtr)MotifFlags.Decorations;
|
||||||
|
Functions.XChangeProperty(API.DefaultDisplay, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints,
|
||||||
|
Marshal.SizeOf(hints) / 4);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
#endregion
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue