]> Dogcows Code - chaz/tint2/blobdiff - src/tint.c
fixed systray_asb in fake transparency (see r407)
[chaz/tint2] / src / tint.c
index 23970f087b32a91208cd67881bdc0cf48922f07b..b0152c63434e7ea74d0ef2b9cb8eab924f059ffd 100644 (file)
@@ -166,9 +166,10 @@ void get_snapshot(const char *path)
 {
        Panel *panel = &panel1[0];
 
-       if (panel->temp_pmap) XFreePixmap(server.dsp, panel->temp_pmap);
-       panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth);
+       if (panel->area.width > server.monitor[0].width)
+               panel->area.width = server.monitor[0].width;
 
+       panel->temp_pmap = XCreatePixmap(server.dsp, server.root_win, panel->area.width, panel->area.height, server.depth);
        refresh(&panel->area);
 
        Imlib_Image img = NULL;
@@ -176,8 +177,14 @@ void get_snapshot(const char *path)
        img = imlib_create_image_from_drawable(0, 0, 0, panel->area.width, panel->area.height, 0);
 
        imlib_context_set_image(img);
+       if (!panel_horizontal) {
+               // rotate 90° vertical panel
+               imlib_image_flip_horizontal();
+               imlib_image_flip_diagonal();
+       }
        imlib_save_image(path);
        imlib_free_image();
+       XFreePixmap(server.dsp, panel->temp_pmap);
 }
 
 
@@ -692,6 +699,8 @@ int main (int argc, char *argv[])
 
        init (argc, argv);
        init_config();
+       init_X11();
+
        i = 0;
        if (config_path)
                i = config_read_file (config_path);
@@ -703,7 +712,6 @@ int main (int argc, char *argv[])
                exit(1);
        }
 
-       init_X11();
        init_panel();
        cleanup_config();
        if (snapshot_path) {
This page took 0.02692 seconds and 4 git commands to generate.