Browse Source
Merge branch 'master' into alloc-boxing
pull/3057/head
Jumar Macato
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
12 additions and
7 deletions
-
src/Avalonia.Base/Utilities/WeakEventHandlerManager.cs
-
src/Avalonia.X11/X11Window.cs
|
|
|
@ -142,10 +142,12 @@ namespace Avalonia.Utilities |
|
|
|
_data = ndata; |
|
|
|
} |
|
|
|
|
|
|
|
MethodInfo method = s.Method; |
|
|
|
|
|
|
|
var subscriber = (TSubscriber)s.Target; |
|
|
|
if (!s_Callers.TryGetValue(s.Method, out var caller)) |
|
|
|
s_Callers[s.Method] = caller = |
|
|
|
(CallerDelegate)Delegate.CreateDelegate(typeof(CallerDelegate), null, s.Method); |
|
|
|
if (!s_Callers.TryGetValue(method, out var caller)) |
|
|
|
s_Callers[method] = caller = |
|
|
|
(CallerDelegate)Delegate.CreateDelegate(typeof(CallerDelegate), null, method); |
|
|
|
_data[_count] = new Descriptor |
|
|
|
{ |
|
|
|
Caller = caller, |
|
|
|
|
|
|
|
@ -100,14 +100,17 @@ namespace Avalonia.X11 |
|
|
|
|
|
|
|
int defaultWidth = 300, defaultHeight = 200; |
|
|
|
|
|
|
|
if (!_popup) |
|
|
|
if (!_popup && Screen != null) |
|
|
|
{ |
|
|
|
var monitor = Screen.AllScreens.OrderBy(x => x.PixelDensity) |
|
|
|
.FirstOrDefault(m => m.Bounds.Contains(Position)); |
|
|
|
|
|
|
|
// Emulate Window 7+'s default window size behavior.
|
|
|
|
defaultWidth = (int)(monitor.WorkingArea.Width * 0.75d); |
|
|
|
defaultHeight = (int)(monitor.WorkingArea.Height * 0.7d); |
|
|
|
if (monitor != null) |
|
|
|
{ |
|
|
|
// Emulate Window 7+'s default window size behavior.
|
|
|
|
defaultWidth = (int)(monitor.WorkingArea.Width * 0.75d); |
|
|
|
defaultHeight = (int)(monitor.WorkingArea.Height * 0.7d); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
_handle = XCreateWindow(_x11.Display, _x11.RootWindow, 10, 10, defaultWidth, defaultHeight, 0, |
|
|
|
|