Created
July 5, 2020 13:33
-
-
Save eHammarstrom/cf465d20690368dc1f5f9a7aaa482ff1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use gdk::prelude::*; | |
use gdk::DisplayManager; | |
fn main() { | |
println!("Hello, world!"); | |
gdk::init(); | |
let display_manager = DisplayManager::get(); | |
let display = display_manager.get_default_display() | |
.expect("Found no display"); | |
let screen = display.get_default_screen(); | |
let root_window = screen.get_root_window() | |
.expect("Unable to retrieve root window"); | |
let root_surface = WindowExtManual::offscreen_window_get_surface(&root_window) | |
.expect("Unable to retrieve root surface"); | |
let root_pixbuf = | |
gdk::pixbuf_get_from_surface(&root_surface, 0, 0, | |
screen.get_width(), screen.get_height()); | |
println!("{:?}", root_pixbuf); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment