Browse Source

Screw wayland, we aren't dealing with "you can't set window coordinates" right now

pull/1230/merge
Nikita Tsukanov 9 years ago
parent
commit
bbfc07b98d
  1. 3
      src/Gtk/Avalonia.Gtk3/Gtk3Platform.cs
  2. 8
      src/Gtk/Avalonia.Gtk3/Interop/Native.cs

3
src/Gtk/Avalonia.Gtk3/Gtk3Platform.cs

@ -35,6 +35,9 @@ namespace Avalonia.Gtk3
X11.XInitThreads();
}catch{}
Resolver.Resolve();
if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux))
using (var backends = new Utf8Buffer("x11"))
Native.GdkSetAllowedBackends?.Invoke(backends);
Native.GtkInit(0, IntPtr.Zero);
var disp = Native.GdkGetDefaultDisplay();
DisplayClassName =

8
src/Gtk/Avalonia.Gtk3/Interop/Native.cs

@ -48,10 +48,13 @@ namespace Avalonia.Gtk3.Interop
public delegate void gtk_main_iteration();
[UnmanagedFunctionPointer(CallingConvention.Cdecl), GtkImport(GtkDll.Gtk)]
public delegate GtkWindow gtk_window_new(GtkWindowType windowType);
public delegate GtkWindow gtk_window_new(GtkWindowType windowType);
[UnmanagedFunctionPointer(CallingConvention.Cdecl), GtkImport(GtkDll.Gtk)]
public delegate IntPtr gtk_init(int argc, IntPtr argv);
[UnmanagedFunctionPointer(CallingConvention.Cdecl), GtkImport(GtkDll.Gdk, optional: true)]
public delegate IntPtr gdk_set_allowed_backends (Utf8Buffer backends);
[UnmanagedFunctionPointer(CallingConvention.Cdecl), GtkImport(GtkDll.Gtk)]
public delegate void gtk_window_present(GtkWindow gtkWindow);
@ -393,6 +396,7 @@ namespace Avalonia.Gtk3.Interop
public static D.gtk_window_new GtkWindowNew;
public static D.gtk_window_set_icon GtkWindowSetIcon;
public static D.gtk_window_set_modal GtkWindowSetModal;
public static D.gdk_set_allowed_backends GdkSetAllowedBackends;
public static D.gtk_init GtkInit;
public static D.gtk_window_present GtkWindowPresent;
public static D.gtk_widget_hide GtkWidgetHide;

Loading…
Cancel
Save