diff --git a/.gitignore b/.gitignore index b3c7234..43edc96 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -SOURCES/sushi-3.8.1.tar.xz +SOURCES/sushi-3.12.0.tar.xz diff --git a/.sushi.metadata b/.sushi.metadata index bf5ad20..7b19069 100644 --- a/.sushi.metadata +++ b/.sushi.metadata @@ -1 +1 @@ -ad51cadec9138e5fdab6e8526d2888a3dfc75d51 SOURCES/sushi-3.8.1.tar.xz +0eea89674b63b6a8347333686ce0679ae7a30c75 SOURCES/sushi-3.12.0.tar.xz diff --git a/SOURCES/0001-mainWindow-use-GDK-for-keyboard-events.patch b/SOURCES/0001-mainWindow-use-GDK-for-keyboard-events.patch new file mode 100644 index 0000000..210647b --- /dev/null +++ b/SOURCES/0001-mainWindow-use-GDK-for-keyboard-events.patch @@ -0,0 +1,59 @@ +From d5e5f06788c8e2adf27856a97409dfdf142c303f Mon Sep 17 00:00:00 2001 +From: Cosimo Cecchi +Date: Mon, 9 Mar 2015 10:36:39 -0700 +Subject: [PATCH] mainWindow: use GDK for keyboard events + +When listening to key events, use the GtkWindow instead of the stage. +This seems to help with a deadlock in the Clutter GDK backend. + +https://bugzilla.gnome.org/show_bug.cgi?id=745738 +--- + src/js/ui/mainWindow.js | 21 ++++++++++++--------- + 1 file changed, 12 insertions(+), 9 deletions(-) + +diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js +index b434a8e..51ccb55 100644 +--- a/src/js/ui/mainWindow.js ++++ b/src/js/ui/mainWindow.js +@@ -124,8 +124,9 @@ MainWindow.prototype = { + this._stage.add_actor(this._mainGroup); + this._mainGroup.set_opacity(0); + +- this._stage.connect('key-press-event', +- Lang.bind(this, this._onStageKeyPressEvent)); ++ this._gtkWindow.connect('key-press-event', ++ Lang.bind(this, this._onKeyPressEvent)); ++ + this._stage.connect('button-press-event', + Lang.bind(this, this._onButtonPressEvent)); + this._stage.connect('motion-event', +@@ -174,17 +175,19 @@ MainWindow.prototype = { + this._clearAndQuit(); + }, + +- _onStageKeyPressEvent : function(actor, event) { +- let key = event.get_key_symbol(); ++ _onKeyPressEvent : function(actor, event) { ++ let key = event.get_keyval()[1]; + +- if (key == Clutter.KEY_Escape || +- key == Clutter.KEY_space || +- key == Clutter.KEY_q) ++ if (key == Gdk.KEY_Escape || ++ key == Gdk.KEY_space || ++ key == Gdk.KEY_q) + this._fadeOutWindow(); + +- if (key == Clutter.KEY_f || +- key == Clutter.KEY_F11) ++ if (key == Gdk.KEY_f || ++ key == Gdk.KEY_F11) + this.toggleFullScreen(); ++ ++ return false; + }, + + _onButtonPressEvent : function(actor, event) { +-- +2.5.0 + diff --git a/SOURCES/0001-text-properly-block-right-click-button-press-event.patch b/SOURCES/0001-text-properly-block-right-click-button-press-event.patch new file mode 100644 index 0000000..46b5826 --- /dev/null +++ b/SOURCES/0001-text-properly-block-right-click-button-press-event.patch @@ -0,0 +1,49 @@ +From 47c7de68cdf12012f2004c0d563374f89f1bcba2 Mon Sep 17 00:00:00 2001 +From: Cosimo Cecchi +Date: Wed, 22 Jul 2015 12:35:32 -0700 +Subject: [PATCH 1/2] text: properly block right click button-press-event + +We used to destroy the menu as a workaround that we could not introspect +the event button. +Now that we can do that, just eat right click events. +This fixes a crash when right clicking with recent GtkSourceView +--- + src/js/viewers/text.js | 15 ++++++++------- + 1 file changed, 8 insertions(+), 7 deletions(-) + +diff --git a/src/js/viewers/text.js b/src/js/viewers/text.js +index 291d51b..2410ec9 100644 +--- a/src/js/viewers/text.js ++++ b/src/js/viewers/text.js +@@ -23,6 +23,7 @@ + * + */ + ++const Gdk = imports.gi.Gdk; + const GtkClutter = imports.gi.GtkClutter; + const Gtk = imports.gi.Gtk; + const GLib = imports.gi.GLib; +@@ -84,13 +85,13 @@ const TextRenderer = new Lang.Class({ + if (this._buffer.get_language()) + this._view.set_show_line_numbers(true); + +- // FIXME: *very* ugly wokaround to the fact that we can't +- // access event.button from a button-press callback to block +- // right click +- this._view.connect('populate-popup', +- Lang.bind(this, function(widget, menu) { +- menu.destroy(); +- })); ++ this._view.connect('button-press-event', Lang.bind(this, function(view, event) { ++ let [, button] = event.get_button(); ++ if (button == Gdk.BUTTON_SECONDARY) ++ return true; ++ ++ return false; ++ })); + + this._scrolledWin = Gtk.ScrolledWindow.new(null, null); + this._scrolledWin.add(this._view); +-- +2.4.6 + diff --git a/SOURCES/0002-text-remove-custom-style.patch b/SOURCES/0002-text-remove-custom-style.patch new file mode 100644 index 0000000..e452a94 --- /dev/null +++ b/SOURCES/0002-text-remove-custom-style.patch @@ -0,0 +1,13 @@ +diff -up sushi-3.12.0/data/style/gtk-style.css.text-style sushi-3.12.0/data/style/gtk-style.css +--- sushi-3.12.0/data/style/gtk-style.css.text-style 2014-04-22 19:14:38.000000000 -0400 ++++ sushi-3.12.0/data/style/gtk-style.css 2015-08-18 11:21:48.045756499 -0400 +@@ -7,8 +7,6 @@ GtkWindow { + } + + GtkSourceView { +- color: @np_text_color; +- background-color: shade (@np_fg_color, 1.10); + font: Monospace 10; + } + +diff -up sushi-3.12.0/src/js/viewers/text.js.text-style sushi-3.12.0/src/js/viewers/text.js diff --git a/SOURCES/0003-mainWindow-listen-to-motion-notify-signals-on-the-wi.patch b/SOURCES/0003-mainWindow-listen-to-motion-notify-signals-on-the-wi.patch new file mode 100644 index 0000000..0b50908 --- /dev/null +++ b/SOURCES/0003-mainWindow-listen-to-motion-notify-signals-on-the-wi.patch @@ -0,0 +1,41 @@ +From 63f137a0ef82fb3d4a5a69d9db24b0052c47502d Mon Sep 17 00:00:00 2001 +From: Cosimo Cecchi +Date: Wed, 22 Jul 2015 13:07:48 -0700 +Subject: [PATCH] mainWindow: listen to motion notify signals on the window + +Instead of the stage. This fixes the events being sometimes eaten, e.g. +with the GtkSourceView viewer. +--- + src/js/ui/mainWindow.js | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js +index f7bb582..0037ce3 100644 +--- a/src/js/ui/mainWindow.js ++++ b/src/js/ui/mainWindow.js +@@ -114,11 +114,11 @@ const MainWindow = new Lang.Class({ + + this._gtkWindow.connect('key-press-event', + Lang.bind(this, this._onKeyPressEvent)); ++ this._gtkWindow.connect('motion-notify-event', ++ Lang.bind(this, this._onMotionNotifyEvent)); + + this._stage.connect('button-press-event', + Lang.bind(this, this._onButtonPressEvent)); +- this._stage.connect('motion-event', +- Lang.bind(this, this._onMotionEvent)); + }, + + _createSolidBackground: function() { +@@ -199,7 +199,7 @@ const MainWindow = new Lang.Class({ + return false; + }, + +- _onMotionEvent : function() { ++ _onMotionNotifyEvent : function() { + if (this._toolbarActor) + this._resetToolbar(); + +-- +2.5.0 + diff --git a/SPECS/sushi.spec b/SPECS/sushi.spec index 9fce38f..26c0a31 100644 --- a/SPECS/sushi.spec +++ b/SPECS/sushi.spec @@ -1,12 +1,17 @@ Name: sushi -Version: 3.8.1 +Version: 3.12.0 Release: 3%{?dist} Summary: A quick previewer for Nautilus Group: User Interface/Desktops License: GPLv2+ with exceptions URL: http://live.gnome.org/ThreePointOne/Features/FilePreviewing -Source0: http://ftp.gnome.org/pub/GNOME/sources/%{name}/3.8/%{name}-%{version}.tar.xz +Source0: http://ftp.gnome.org/pub/GNOME/sources/%{name}/3.12/%{name}-%{version}.tar.xz + +Patch0: 0001-text-properly-block-right-click-button-press-event.patch +Patch1: 0002-text-remove-custom-style.patch +Patch2: 0001-mainWindow-use-GDK-for-keyboard-events.patch +Patch3: 0003-mainWindow-listen-to-motion-notify-signals-on-the-wi.patch BuildRequires: gtksourceview3-devel BuildRequires: intltool @@ -30,6 +35,10 @@ file manager. %prep %setup -q +%patch0 -p1 +%patch1 -p1 +%patch2 -p1 +%patch3 -p1 %build %configure --disable-static @@ -57,6 +66,17 @@ find $RPM_BUILD_ROOT -name '*.la' -exec rm -f {} ';' %changelog +* Tue Aug 18 2015 Matthias Clasen - 3.13.0-3 +- Fix an undefined variable +Resolve: #1254181 + +* Wed Jul 22 2015 Matthias Clasen - 3.13.0-2 +- Fix a crash and some other issues with text preview +Resolves: #1207706 + +* Mon Mar 23 2015 Richard Hughes - 3.12.0-1 +- Update to 3.12.0 + * Fri Jan 24 2014 Daniel Mach - 3.8.1-3 - Mass rebuild 2014-01-24