Browse Source

Set a ratio of client size as default window size on xorg.

pull/3009/head
Jumar Macato 7 years ago
parent
commit
3ede24cf74
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 13
      src/Avalonia.X11/X11Window.cs

13
src/Avalonia.X11/X11Window.cs

@ -98,14 +98,23 @@ namespace Avalonia.X11
valueMask |= SetWindowValuemask.ColorMap;
}
_handle = XCreateWindow(_x11.Display, _x11.RootWindow, 10, 10, 300, 200, 0,
int defaultWidth = 300, defaultHeight = 200;
if (!_popup)
{
// Emulate Window 7+'s default window size behavior.
defaultWidth = (int)(MaxClientSize.Width * 0.75d);
defaultHeight = (int)(MaxClientSize.Height * 0.7d);
}
_handle = XCreateWindow(_x11.Display, _x11.RootWindow, 10, 10, defaultWidth, defaultHeight, 0,
depth,
(int)CreateWindowArgs.InputOutput,
visual,
new UIntPtr((uint)valueMask), ref attr);
if (_useRenderWindow)
_renderHandle = XCreateWindow(_x11.Display, _handle, 0, 0, 300, 200, 0, depth,
_renderHandle = XCreateWindow(_x11.Display, _handle, 0, 0, defaultWidth, defaultHeight, 0, depth,
(int)CreateWindowArgs.InputOutput,
visual,
new UIntPtr((uint)(SetWindowValuemask.BorderPixel | SetWindowValuemask.BitGravity |

Loading…
Cancel
Save