Skip to content

Commit f8095e4

Browse files
committed
* Improving fix to take screenshots.
1 parent 9c86e3b commit f8095e4

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

src/MainWindow.vala

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -545,14 +545,11 @@ public class MainWindow : Gtk.ApplicationWindow {
545545
}
546546

547547
//-------------------------------------------------------------
548-
// Main procedure that initiates a screenshot. If we are using
549-
// elementary OS 7.1 or below, we will roll our own screenshot
550-
// UI and functionality; otherwise, we will use the screenshot
551-
// portal.
548+
// Main procedure that initiates a screenshot. If the backend
549+
// indicates that it can handle taking the screenshot, use the
550+
// backend to perform the screenshot; otherwise, use the portal.
552551
public void do_screenshot( Widget? parent ) {
553-
var os = Environment.get_os_info( "ID" );
554-
var version = Environment.get_os_info( "VERSION" );
555-
if( (os == "elementary") && (double.parse(version) < 8.0) ) {
552+
if( ScreenshotBackend.can_do_screenshots() ) {
556553
if( parent == null ) {
557554
do_screenshot_nonportal( CaptureType.SCREEN );
558555
} else {

src/ScreenshotBackend.vala

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,7 @@ public class ScreenshotBackend : Object {
9494
try {
9595
var introspectable = get_instrospectable();
9696
return true;
97-
} catch (Error e) {
98-
warning ("Can not take screenshots on this system: %s\n", e.message);
99-
}
97+
} catch (Error e) {}
10098
return false;
10199
}
102100

0 commit comments

Comments
 (0)