i3/include
Uli Schlachter 60542da091
Do not "set" the wallpaper during startup (#4373)
"Set" the wallpaper during startup only sometimes

Since commit 4f5e0e7, i3 would take a screenshot and set that as the
background pixmap of the root window during startup. This is the easy
part of setting a proper X11 wallpaper.

The code in question was added because something either set the
background pixmap of the root window to NONE or the X11 server was
started with "-background none". This is apparently done by default by
e.g. gdm to avoid some flickering while the X11 server starts up.

This commit makes this code conditional: Only when no wallpaper is
detected is a screenshot taken.

Since I could not find any way to query the background of a window, a
more direct approach is taken to detect this situation: First, we find
some part of the root window that is not currently covered. Then we open
a white window there, close it again and grab a screenshot. If a
wallpaper is set, the X11 server will draw this wallpaper after the
window is closed and something else will be visible in the screenshot.

However, the wallpaper could have a white pixel at the tested position.
Thus, this procedure is repeated with a black window.

Only when this procedure produces two different pixel values is a
screenshot taken and set as the wallpaper.

Fixes: https://github.com/i3/i3/issues/4371
Fixes: https://github.com/i3/i3/issues/2869
Signed-off-by: Uli Schlachter <psychon@znc.in>
2021-05-20 21:37:35 +02:00
..
i3 Introduce GET_BINDING_STATE IPC command 2020-06-06 20:39:05 +02:00
all.h Remove unused header file and references to it 2020-12-30 21:40:54 +01:00
assignments.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
bindings.h Introduce --exclude-titlebar flag for mouse bindings. (#2703) 2017-05-02 09:08:42 +02:00
click.h handle_button_press and route_click do not need to return int 2020-04-09 16:16:30 +02:00
commands_parser.h Make restart IPC command send a reply once restart completed (!) (#3743) 2019-07-21 14:52:12 +02:00
commands.h Accept multiple outputs in move container|workspace to output 2021-02-06 11:00:16 +01:00
con.h Introduce con_activate_unblock 2019-10-09 02:31:52 +03:00
config_directives.h Add setting for minimal width of workspace buttons 2019-06-25 13:10:01 +07:00
config_parser.h Make comment style more consistent 2018-10-13 21:10:10 +03:00
configuration.h clang-format: use TypenameMacros 2020-10-20 09:36:44 +02:00
data.h Add "machine" criterion to match WM_CLIENT_MACHINE 2021-01-28 12:52:10 +01:00
display_version.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
drag.h drag_pointer(): add use_treshold parameter 2019-10-03 06:09:57 +00:00
ewmh.h Call all ewmh_update_* functions together when necessary 2019-05-03 16:19:11 +03:00
fake_outputs.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
floating.h Only set FLOATING_AUTO_ON when floating_enable succeeds 2020-04-27 13:43:53 +02:00
handlers.h Remove dead declarations in header files 2020-10-18 17:28:09 +02:00
i3-atoms_NET_SUPPORTED.xmacro.h xmacro: declare in header files, instantiate instead of include 2020-05-17 16:38:43 +02:00
i3-atoms_rest.xmacro.h i3-dump-log -f: switch from pthreads to UNIX sockets 2021-01-20 21:40:24 +01:00
i3.h clang-format: use TypenameMacros 2020-10-20 09:36:44 +02:00
ipc.h i3-dump-log -f: switch from pthreads to UNIX sockets 2021-01-20 21:40:24 +01:00
key_press.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
libi3.h Do not "set" the wallpaper during startup (#4373) 2021-05-20 21:37:35 +02:00
load_layout.h validate JSON before loading 2017-09-13 17:41:05 +02:00
log.h i3-dump-log -f: switch from pthreads to UNIX sockets 2021-01-20 21:40:24 +01:00
main.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
manage.h Remanage window after property updates (like titles) (#3759) 2019-08-13 08:50:48 +02:00
match.h Make comment style more consistent 2018-10-13 21:10:10 +03:00
move.h Introduce direction / orientation / position conversion functions 2019-10-14 02:38:53 +03:00
output.h output_push_sticky_windows: Make a bit easier to understand 2018-10-11 12:27:56 +03:00
queue.h switch to clang-format-3.8 (#2547) 2016-11-08 13:46:43 -08:00
randr.h Merge pull request #3397 from orestisf1993/randr-enable-disable 2018-11-10 21:56:34 +01:00
regex.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
render.h render_con: Get rid of render_fullscreen argument 2018-11-12 19:05:50 +02:00
resize.h Tiling resize drag: use threshold 2019-10-03 06:09:57 +00:00
restore_layout.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00
scratchpad.h Make "scratchpad show" return correct info 2018-04-20 22:30:41 +08:00
sd-daemon.h Replace http:// with https:// where applicable 2017-09-24 10:19:07 +02:00
shmlog.h i3-dump-log -f: switch from pthreads to UNIX sockets 2021-01-20 21:40:24 +01:00
sighandler.h Rewrite the signal handler dialogs. 2017-01-10 20:13:25 +01:00
startup.h Remanage window after property updates (like titles) (#3759) 2019-08-13 08:50:48 +02:00
sync.h move i3 sync code into sync_respond (for following commits) 2018-03-30 21:05:32 +02:00
tree.h Refactor tree_next 2019-10-14 03:31:24 +03:00
util.h kill_nagbar: No need for pointer to pid_t 2020-05-24 13:04:33 +02:00
window.h Add "machine" criterion to match WM_CLIENT_MACHINE 2021-01-28 12:52:10 +01:00
workspace.h Make get_assigned_output public 2020-10-18 17:28:14 +02:00
x.h Add input and bounding shapes support (#2742) 2018-12-01 11:52:41 +07:00
xcb.h xmacro: declare in header files, instantiate instead of include 2020-05-17 16:38:43 +02:00
xcursor.h Assume xcb_cursor_context_new never fails (#3955) 2020-02-24 08:48:58 +01:00
xinerama.h Remove some includes from all.h 2020-04-20 05:54:17 +02:00
yajl_utils.h Ensure all *.[ch] files include config.h 2016-10-23 21:09:24 +02:00