On Tue, 2014-01-07 at 15:08 +0100, Martin Kolman wrote:
Looks like you indeed can make full-screen screenshots
with GTK/GDK only!
Thanks goes to Ray Strode (halfline) for the hint! :)
Signed-off-by: Martin Kolman <mkolman(a)redhat.com>
---
anaconda.spec.in | 1 -
pyanaconda/ui/gui/__init__.py | 15 ++++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/anaconda.spec.in b/anaconda.spec.in
index f8576bc..cb648e9 100755
--- a/anaconda.spec.in
+++ b/anaconda.spec.in
@@ -166,7 +166,6 @@ Requires: nm-connection-editor
%ifarch %livearches
Requires: zenity
%endif
-Requires: scrot
Requires: keybinder3
%description gui
diff --git a/pyanaconda/ui/gui/__init__.py b/pyanaconda/ui/gui/__init__.py
index e2e0cfc..a28bc03 100644
--- a/pyanaconda/ui/gui/__init__.py
+++ b/pyanaconda/ui/gui/__init__.py
@@ -25,7 +25,6 @@ from gi.repository import Gdk, Gtk, AnacondaWidgets, Keybinder
from pyanaconda.i18n import _
from pyanaconda import product
-from pyanaconda import iutil
from pyanaconda.ui import UserInterface, common
from pyanaconda.ui.gui.utils import enlightbox, gtk_action_wait, busyCursor,
unbusyCursor
@@ -243,15 +242,17 @@ class GUIObject(common.UIObject):
fn = os.path.join(self.screenshots_directory,
"screenshot-%04d.png" % _screenshotIndex)
- rc = iutil.execWithRedirect("scrot", [fn])
- if rc == 0:
- log.info("screenshot nr. %d taken", _screenshotIndex)
- _screenshotIndex += 1
- else:
- log.error("taking screenshot failed")
+ root_window = Gdk.get_default_root_window()
+ pixbuf = Gdk.pixbuf_get_from_window(root_window, 0, 0,
+ root_window.get_width(),
+ root_window.get_height())
+ pixbuf.savev(fn, 'png', [], [])
+ log.info("screenshot nr. %d taken" % _screenshotIndex)
+ _screenshotIndex += 1
# start counting from the time the screenshot operation is done
_last_screenshot_timestamp = time.time()
+
No need for this extra blank line. Otherwise ACK.
--
Vratislav Podzimek
Anaconda Rider | Red Hat, Inc. | Brno - Czech Republic