Remove/activate decorations through gnome.

This commit is contained in:
the_fiddler 2008-01-27 11:28:37 +00:00
parent ec2df7ffc6
commit e6e27ea3ea

View file

@ -700,6 +700,7 @@ namespace OpenTK.Platform.X11
{ {
bool removed = false; bool removed = false;
if (DisableMotifDecorations()) { Debug.Print("Removed decorations through motif."); removed = true; } if (DisableMotifDecorations()) { Debug.Print("Removed decorations through motif."); removed = true; }
if (DisableGnomeDecorations()) { Debug.Print("Removed decorations through gnome."); removed = true; }
if (removed) if (removed)
{ {
@ -709,6 +710,8 @@ namespace OpenTK.Platform.X11
} }
} }
#region bool DisableMotifDecorations()
bool DisableMotifDecorations() bool DisableMotifDecorations()
{ {
IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_MOTIF_WM_HINTS", true); IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_MOTIF_WM_HINTS", true);
@ -725,12 +728,32 @@ namespace OpenTK.Platform.X11
#endregion #endregion
#region bool DisableGnomeDecorations()
bool DisableGnomeDecorations()
{
IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_WIN_HINTS", true);
if (atom != IntPtr.Zero)
{
IntPtr hints = IntPtr.Zero;
Functions.XChangeProperty(API.DefaultDisplay, this.Handle, atom, atom, 32, PropertyMode.Replace, ref hints,
Marshal.SizeOf(hints) / 4);
return true;
}
return false;
}
#endregion
#endregion
#region void EnableWindowDecorations() #region void EnableWindowDecorations()
void EnableWindowDecorations() void EnableWindowDecorations()
{ {
bool activated = false; bool activated = false;
if (EnableMotifDecorations()) { Debug.Print("Activated decorations through motif."); activated = true; } if (EnableMotifDecorations()) { Debug.Print("Activated decorations through motif."); activated = true; }
if (EnableGnomeDecorations()) { Debug.Print("Activated decorations through gnome."); activated = true; }
if (activated) if (activated)
{ {
@ -740,7 +763,24 @@ namespace OpenTK.Platform.X11
} }
} }
#region bool EnableMotifDecorations()
bool EnableMotifDecorations() bool EnableMotifDecorations()
{
IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_WIN_HINTS", true);
if (atom != IntPtr.Zero)
{
Functions.XDeleteProperty(API.DefaultDisplay, this.Handle, atom);
return true;
}
return false;
}
#endregion
#region bool EnableGnomeDecorations()
bool EnableGnomeDecorations()
{ {
IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_MOTIF_WM_HINTS", true); IntPtr atom = Functions.XInternAtom(API.DefaultDisplay, "_MOTIF_WM_HINTS", true);
if (atom != IntPtr.Zero) if (atom != IntPtr.Zero)
@ -754,5 +794,7 @@ namespace OpenTK.Platform.X11
#endregion #endregion
#endregion #endregion
#endregion
} }
} }