mirror of
https://github.com/moparisthebest/FireTray
synced 2024-08-13 15:53:47 -04:00
Merge branch 'gtk-version'
This commit is contained in:
commit
630b36b05e
@ -89,6 +89,7 @@ firetray.Handler = {
|
||||
VersionChange.addHook(["upgrade", "reinstall"], firetray.VersionChangeHandler.correctMailServerTypes);
|
||||
VersionChange.applyHooksAndWatchUninstall();
|
||||
|
||||
firetray.Window.init();
|
||||
firetray.StatusIcon.init();
|
||||
firetray.Handler.showHideIcon();
|
||||
log.debug('StatusIcon initialized');
|
||||
|
@ -302,6 +302,7 @@ function gdk_defines(lib) {
|
||||
lib.lazy_bind("gdk_window_get_user_data", ctypes.void_t, this.GdkWindow.ptr, gobject.gpointer.ptr);
|
||||
lib.lazy_bind("gdk_atom_intern", this.GdkAtom, gobject.gchar.ptr, gobject.gboolean);
|
||||
lib.lazy_bind("gdk_property_change", ctypes.void_t, this.GdkWindow.ptr, this.GdkAtom, this.GdkAtom, gobject.gint, this.GdkPropMode, gobject.guchar.ptr, gobject.gint);
|
||||
lib.lazy_bind("gdk_window_get_toplevel", this.GdkWindow.ptr, this.GdkWindow.ptr);
|
||||
lib.lazy_bind("gdk_window_get_effective_toplevel", this.GdkWindow.ptr, this.GdkWindow.ptr);
|
||||
|
||||
lib.lazy_bind("gdk_display_get_n_screens", gobject.gint, this.GdkDisplay.ptr);
|
||||
|
@ -17,6 +17,10 @@ Cu.import("resource://firetray/ctypes/linux/gobject.jsm");
|
||||
Cu.import("resource://firetray/ctypes/linux/pango.jsm");
|
||||
|
||||
function gtk_defines(lib) {
|
||||
this.FIRETRAY_REQUIRED_GTK_MAJOR_VERSION = 2;
|
||||
this.FIRETRAY_REQUIRED_GTK_MINOR_VERSION = 20;
|
||||
this.FIRETRAY_REQUIRED_GTK_MICRO_VERSION = 0;
|
||||
|
||||
this.GTK_ICON_SIZE_MENU = 1; // enum GtkIconSize
|
||||
this.GTK_WINDOW_TOPLEVEL = 0; // enum GtkWindowType
|
||||
|
||||
@ -78,6 +82,7 @@ function gtk_defines(lib) {
|
||||
ctypes.default_abi, gobject.gboolean,
|
||||
[this.GtkWidget.ptr, gdk.GdkEventFocus.ptr, gobject.gpointer]).ptr;
|
||||
|
||||
lib.lazy_bind("gtk_check_version", gobject.gchar.ptr, gobject.guint, gobject.guint, gobject.guint);
|
||||
|
||||
lib.lazy_bind("gtk_icon_theme_get_default", this.GtkIconTheme.ptr);
|
||||
lib.lazy_bind("gtk_icon_theme_get_for_screen", this.GtkIconTheme.ptr, gdk.GdkScreen.ptr);
|
||||
|
@ -60,6 +60,14 @@ firetray.Handler.gtkPopupMenuWindowItems = new ctypesMap(gtk.GtkImageMenuItem.pt
|
||||
firetray.Window = {
|
||||
|
||||
init: function() {
|
||||
let gtkVersionCheck = gtk.gtk_check_version(
|
||||
gtk.FIRETRAY_REQUIRED_GTK_MAJOR_VERSION,
|
||||
gtk.FIRETRAY_REQUIRED_GTK_MINOR_VERSION,
|
||||
gtk.FIRETRAY_REQUIRED_GTK_MICRO_VERSION
|
||||
);
|
||||
if (!gtkVersionCheck.isNull())
|
||||
log.error("gtk_check_version="+gtkVersionCheck.readString());
|
||||
|
||||
this.initialized = true;
|
||||
},
|
||||
|
||||
@ -157,7 +165,7 @@ firetray.Window = {
|
||||
|
||||
getGdkWindowFromNativeHandle: function(nativeHandle) {
|
||||
let gdkw = new gdk.GdkWindow.ptr(ctypes.UInt64(nativeHandle)); // a new pointer to the GdkWindow
|
||||
gdkw = gdk.gdk_window_get_effective_toplevel(gdkw);
|
||||
gdkw = gdk.gdk_window_get_toplevel(gdkw);
|
||||
log.debug("gdkw="+gdkw+" *gdkw="+this.addrPointedByInHex(gdkw));
|
||||
return gdkw;
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user