diff --git a/.gitignore b/.gitignore index 3804bcc..4dd97bf 100644 --- a/.gitignore +++ b/.gitignore @@ -25,3 +25,4 @@ gajim-0.13.4.tar.bz2 /gajim-1.0.0.tar.bz2 /gajim-1.0.1.tar.bz2 /gajim-1.0.3.tar.bz2 +/gajim-1.1.0.tar.bz2 diff --git a/0001-Prefer-X11-to-Wayland-GDK-backend.patch b/0001-Prefer-X11-to-Wayland-GDK-backend.patch new file mode 100644 index 0000000..7b6a996 --- /dev/null +++ b/0001-Prefer-X11-to-Wayland-GDK-backend.patch @@ -0,0 +1,30 @@ +From 8eff4008ede97886bfceb8c158018982b8493484 Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Thu, 26 Jul 2018 16:40:10 +0200 +Subject: [PATCH] Prefer X11 to Wayland GDK backend + +Gtk.StatusIcon is not implemented for Wayland. + +Prefer running with the 'x11' GDK backend, where the status icon works. +--- + gajim/gajim.py | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/gajim/gajim.py b/gajim/gajim.py +index 60e817f2c7..a1585f111b 100644 +--- a/gajim/gajim.py ++++ b/gajim/gajim.py +@@ -50,6 +50,10 @@ def _init_gui(gui): + + + def _init_gtk(): ++ # Prefer x11 to wayland for a working Gtk.StatusIcon ++ if 'GDK_BACKEND' not in os.environ: ++ os.environ['GDK_BACKEND']='x11' ++ + import gi + gi.require_version('GLib', '2.0') + gi.require_version('Gio', '2.0') +-- +2.19.1 + diff --git a/0001-Support-for-idle-time-under-GNOME-without-X11.patch b/0001-Support-for-idle-time-under-GNOME-without-X11.patch deleted file mode 100644 index ca8c4e7..0000000 --- a/0001-Support-for-idle-time-under-GNOME-without-X11.patch +++ /dev/null @@ -1,231 +0,0 @@ -From dc22c2a129402d334103ccba61e202f503237144 Mon Sep 17 00:00:00 2001 -From: Sophie Herold -Date: Sun, 20 May 2018 16:07:08 +0200 -Subject: [PATCH 1/3] Support for idle time under GNOME without X11 - -* Removes use of most global variables -* Adds some some logging -* Removes unused close() method for Xss - -(cherry picked from commit 2e5d966f1d715f20f112dd9370f6ccd13fcaeca9) ---- - gajim/common/idle.py | 168 ++++++++++++++++++++++++++++------------- - gajim/common/sleepy.py | 3 +- - 2 files changed, 115 insertions(+), 56 deletions(-) - -diff --git a/gajim/common/idle.py b/gajim/common/idle.py -index 9e475c47dd..4a715294eb 100644 ---- a/gajim/common/idle.py -+++ b/gajim/common/idle.py -@@ -18,6 +18,58 @@ - - import ctypes - import ctypes.util -+import logging -+from gi.repository import Gio -+from gi.repository import GLib -+ -+log = logging.getLogger('gajim.c.idle') -+ -+idle_monitor = None -+ -+ -+class DBusGnomeIdleMonitor: -+ -+ def __init__(self): -+ self.last_idle_time = 0 -+ -+ log.debug('Connecting to D-Bus') -+ self.dbus_gnome_proxy = Gio.DBusProxy.new_for_bus_sync( -+ Gio.BusType.SESSION, -+ Gio.DBusProxyFlags.NONE, -+ None, -+ 'org.gnome.Mutter.IdleMonitor', -+ '/org/gnome/Mutter/IdleMonitor/Core', -+ 'org.gnome.Mutter.IdleMonitor', -+ None -+ ) -+ log.debug('D-Bus connected') -+ -+ # Only the following call will trigger exceptions if the D-Bus -+ # interface/method/... does not exist. Using the failing method -+ # for class init to allow other idle monitors to be used on failure. -+ self._get_idle_sec_fail() -+ log.debug('D-Bus call test successful') -+ -+ def _get_idle_sec_fail(self): -+ (idle_time,) = self.dbus_gnome_proxy.call_sync( -+ 'GetIdletime', -+ None, -+ Gio.DBusCallFlags.NO_AUTO_START, -+ -1, -+ None -+ ) -+ return int(idle_time / 1000) -+ -+ def get_idle_sec(self): -+ try: -+ self.last_idle_time = self._get_idle_sec_fail() -+ except GLib.Error as e: -+ log.warning( -+ 'org.gnome.Mutter.IdleMonitor.GetIdletime() failed: %s', -+ repr(e)) -+ -+ return self.last_idle_time -+ - - class XScreenSaverInfo(ctypes.Structure): - _fields_ = [ -@@ -28,72 +80,80 @@ class XScreenSaverInfo(ctypes.Structure): - ('idle', ctypes.c_ulong), - ('eventMask', ctypes.c_ulong) - ] --XScreenSaverInfo_p = ctypes.POINTER(XScreenSaverInfo) - --display_p = ctypes.c_void_p --xid = ctypes.c_ulong --c_int_p = ctypes.POINTER(ctypes.c_int) - --try: -- libX11path = ctypes.util.find_library('X11') -- if libX11path == None: -- raise OSError('libX11 could not be found.') -- libX11 = ctypes.cdll.LoadLibrary(libX11path) -- libX11.XOpenDisplay.restype = display_p -- libX11.XOpenDisplay.argtypes = ctypes.c_char_p, -- libX11.XDefaultRootWindow.restype = xid -- libX11.XDefaultRootWindow.argtypes = display_p, -- -- libXsspath = ctypes.util.find_library('Xss') -- if libXsspath == None: -- raise OSError('libXss could not be found.') -- libXss = ctypes.cdll.LoadLibrary(libXsspath) -- libXss.XScreenSaverQueryExtension.argtypes = display_p, c_int_p, c_int_p -- libXss.XScreenSaverAllocInfo.restype = XScreenSaverInfo_p -- libXss.XScreenSaverQueryInfo.argtypes = (display_p, xid, XScreenSaverInfo_p) -- -- dpy_p = libX11.XOpenDisplay(None) -- if dpy_p == None: -- raise OSError('Could not open X Display.') -- -- _event_basep = ctypes.c_int() -- _error_basep = ctypes.c_int() -- if libXss.XScreenSaverQueryExtension(dpy_p, ctypes.byref(_event_basep), -- ctypes.byref(_error_basep)) == 0: -- raise OSError('XScreenSaver Extension not available on display.') -- -- xss_info_p = libXss.XScreenSaverAllocInfo() -- if xss_info_p == None: -- raise OSError('XScreenSaverAllocInfo: Out of Memory.') -- -- rootwindow = libX11.XDefaultRootWindow(dpy_p) -- xss_available = True --except OSError: -- # Logging? -- xss_available = False -+class XssIdleMonitor: -+ def __init__(self): -+ XScreenSaverInfo_p = ctypes.POINTER(XScreenSaverInfo) -+ -+ display_p = ctypes.c_void_p -+ xid = ctypes.c_ulong -+ c_int_p = ctypes.POINTER(ctypes.c_int) -+ -+ libX11path = ctypes.util.find_library('X11') -+ if libX11path == None: -+ raise OSError('libX11 could not be found.') -+ libX11 = ctypes.cdll.LoadLibrary(libX11path) -+ libX11.XOpenDisplay.restype = display_p -+ libX11.XOpenDisplay.argtypes = ctypes.c_char_p, -+ libX11.XDefaultRootWindow.restype = xid -+ libX11.XDefaultRootWindow.argtypes = display_p, -+ -+ libXsspath = ctypes.util.find_library('Xss') -+ if libXsspath == None: -+ raise OSError('libXss could not be found.') -+ self.libXss = ctypes.cdll.LoadLibrary(libXsspath) -+ self.libXss.XScreenSaverQueryExtension.argtypes = display_p, c_int_p, c_int_p -+ self.libXss.XScreenSaverAllocInfo.restype = XScreenSaverInfo_p -+ self.libXss.XScreenSaverQueryInfo.argtypes = (display_p, xid, XScreenSaverInfo_p) -+ -+ self.dpy_p = libX11.XOpenDisplay(None) -+ if self.dpy_p == None: -+ raise OSError('Could not open X Display.') -+ -+ _event_basep = ctypes.c_int() -+ _error_basep = ctypes.c_int() -+ if self.libXss.XScreenSaverQueryExtension(self.dpy_p, ctypes.byref(_event_basep), -+ ctypes.byref(_error_basep)) == 0: -+ raise OSError('XScreenSaver Extension not available on display.') -+ -+ self.xss_info_p = self.libXss.XScreenSaverAllocInfo() -+ if self.xss_info_p == None: -+ raise OSError('XScreenSaverAllocInfo: Out of Memory.') -+ -+ self.rootwindow = libX11.XDefaultRootWindow(self.dpy_p) -+ -+ def get_idle_sec(self): -+ if self.libXss.XScreenSaverQueryInfo( -+ self.dpy_p, -+ self.rootwindow, -+ self.xss_info_p) == 0: -+ return 0 -+ else: -+ return int(self.xss_info_p.contents.idle / 1000) -+ - - def getIdleSec(): -- global xss_available - """ - Return the idle time in seconds - """ -- if not xss_available: -- return 0 -- if libXss.XScreenSaverQueryInfo(dpy_p, rootwindow, xss_info_p) == 0: -+ if idle_monitor is None: - return 0 - else: -- return int(xss_info_p.contents.idle) / 1000 -+ return idle_monitor.get_idle_sec() - --def close(): -- global xss_available -- if xss_available: -- libX11.XFree(xss_info_p) -- libX11.XCloseDisplay(dpy_p) -- xss_available = False -+try: -+ idle_monitor = DBusGnomeIdleMonitor() -+except GLib.Error as e: -+ log.info("Idle time via D-Bus not available: %s", repr(e)) -+ -+ try: -+ idle_monitor = XssIdleMonitor() -+ except OSError as e: -+ log.info("Idle time via XScreenSaverInfo not available: %s", repr(e)) -+ raise Exception('No supported idle monitor found') - - if __name__ == '__main__': - import time - time.sleep(2.1) - print(getIdleSec()) -- close() -- print(getIdleSec()) -diff --git a/gajim/common/sleepy.py b/gajim/common/sleepy.py -index ca3395e520..721766d910 100644 ---- a/gajim/common/sleepy.py -+++ b/gajim/common/sleepy.py -@@ -53,9 +53,8 @@ try: - SystemParametersInfo = ctypes.windll.user32.SystemParametersInfoW - else: # unix - from gajim.common import idle -- idle.xss_available - except Exception: -- log.debug('Unable to load idle module') -+ log.warning('Unable to load idle module') - SUPPORTED = False - - class SleepyWindows: --- -2.17.1 - diff --git a/0002-Prefer-X11-to-Wayland-GDK-backend.patch b/0002-Prefer-X11-to-Wayland-GDK-backend.patch deleted file mode 100644 index 15140d0..0000000 --- a/0002-Prefer-X11-to-Wayland-GDK-backend.patch +++ /dev/null @@ -1,30 +0,0 @@ -From e323a681fd821256b37079c60e308a1c130693c2 Mon Sep 17 00:00:00 2001 -From: Michal Schmidt -Date: Thu, 26 Jul 2018 16:40:10 +0200 -Subject: [PATCH 2/3] Prefer X11 to Wayland GDK backend - -Gtk.StatusIcon is not implemented for Wayland. - -Prefer running with the 'x11' GDK backend, where the status icon works. ---- - gajim/gajim.py | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/gajim/gajim.py b/gajim/gajim.py -index c2e1f9ace5..56923bc5fb 100644 ---- a/gajim/gajim.py -+++ b/gajim/gajim.py -@@ -43,6 +43,10 @@ import signal - import locale - from urllib.parse import unquote - -+# Prefer x11 to wayland for a working Gtk.StatusIcon -+if 'GDK_BACKEND' not in os.environ: -+ os.environ['GDK_BACKEND']='x11' -+ - import gi - gi.require_version('GLib', '2.0') - gi.require_version('Gio', '2.0') --- -2.17.1 - diff --git a/0003-Do-not-use-global-app-menu.patch b/0003-Do-not-use-global-app-menu.patch deleted file mode 100644 index 29ef688..0000000 --- a/0003-Do-not-use-global-app-menu.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 54d3b6eebf6cce38c9ed25524d9c1b73d661034c Mon Sep 17 00:00:00 2001 -From: Michal Schmidt -Date: Fri, 27 Jul 2018 17:29:17 +0200 -Subject: [PATCH 3/3] Do not use global app menu - -To avoid changing the UI too much in updates to stable Fedora releases, -avoid using the global app menu. ---- - gajim/common/app.py | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gajim/common/app.py b/gajim/common/app.py -index e8e3c7ec53..9f16d9a250 100644 ---- a/gajim/common/app.py -+++ b/gajim/common/app.py -@@ -576,4 +576,4 @@ def prefers_app_menu(): - return True - if sys.platform == 'win32': - return False -- return app.prefers_app_menu() -+ return False #app.prefers_app_menu() --- -2.17.1 - diff --git a/0004-Do-not-use-global-app-menu.patch b/0004-Do-not-use-global-app-menu.patch new file mode 100644 index 0000000..0a058d7 --- /dev/null +++ b/0004-Do-not-use-global-app-menu.patch @@ -0,0 +1,27 @@ +From c1ac416838ac86c85eeec2fbd1ffc7ce570f8aca Mon Sep 17 00:00:00 2001 +From: Michal Schmidt +Date: Fri, 27 Jul 2018 17:29:17 +0200 +Subject: [PATCH 4/4] Do not use global app menu + +To avoid changing the UI too much in updates to stable Fedora releases, +avoid using the global app menu. +--- + gajim/common/app.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/gajim/common/app.py b/gajim/common/app.py +index 63b7e2e614..d586b6fe53 100644 +--- a/gajim/common/app.py ++++ b/gajim/common/app.py +@@ -628,7 +628,7 @@ def prefers_app_menu(): + return True + if sys.platform == 'win32': + return False +- return app.prefers_app_menu() ++ return False #app.prefers_app_menu() + + def get_app_window(cls, account=None): + for win in app.get_windows(): +-- +2.20.1 + diff --git a/gajim.spec b/gajim.spec index 3bdc0f1..94d0684 100644 --- a/gajim.spec +++ b/gajim.spec @@ -2,21 +2,20 @@ Summary: Jabber client written in PyGTK Name: gajim -%global majorver 1.0 -Version: 1.0.3 -Release: 3%{?dist}.1 +%global majorver 1.1 +Version: 1.1.0 +Release: 1%{?dist} License: GPLv3 URL: https://gajim.org/ Source0: https://gajim.org/downloads/%{majorver}/%{name}-%{version}.tar.bz2 -Patch0001: 0001-Support-for-idle-time-under-GNOME-without-X11.patch -Patch0002: 0002-Prefer-X11-to-Wayland-GDK-backend.patch -Patch0003: 0003-Do-not-use-global-app-menu.patch +Patch0002: 0001-Prefer-X11-to-Wayland-GDK-backend.patch +Patch0004: 0004-Do-not-use-global-app-menu.patch BuildArch: noarch ## Hard requirements Requires: python3-gobject Requires: gtk3 -Requires: python3-nbxmpp >= 0.6.6 +Requires: python3-nbxmpp >= 0.6.8 Requires: hicolor-icon-theme Requires: python3-pyOpenSSL Requires: python3-pyasn1 @@ -106,6 +105,9 @@ appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{appid}. %{python3_sitelib}/%{name}-%{version}*.egg-info %changelog +* Wed Nov 14 2018 Michal Schmidt - 1.1.0-1 +- Upstream release 1.1.0. + * Fri Jul 27 2018 Michal Schmidt - 1.0.3-3.fc28.1 - Do not use app global menu in F28, F27. diff --git a/sources b/sources index d39f7fd..94374ee 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (gajim-1.0.3.tar.bz2) = a6d7f92a22a9dddc8a4b07eda0aae0b6fb4db57c73133ee19937f7e2a2a82c5351051d1f3627c94a44434276ed001b83d375f708f177962125af66cda8579ec8 +SHA512 (gajim-1.1.0.tar.bz2) = 47b18de111643eba382255e7c2d195b41f30bf15957cd27939ebd44eade7af1b9ebe50c30ca10f33ca36e879d309fc414369fd8ba2c725c336f38a3a0f88ba7c