Merge remote-tracking branch 'vanilla/next' into gaps-next
Ingo Bürk
4 years ago
378 | 378 | |
379 | 379 | i3_nagbar_i3_nagbar_SOURCES = \ |
380 | 380 | i3-nagbar/atoms.xmacro \ |
381 | i3-nagbar/i3-nagbar.h \ | |
382 | 381 | i3-nagbar/main.c |
383 | 382 | |
384 | 383 | i3bar_i3bar_CPPFLAGS = \ |
116 | 116 | open(my $enumfh, '>', "GENERATED_${prefix}_enums.h"); |
117 | 117 | |
118 | 118 | my %statenum; |
119 | say $enumfh '#pragma once'; | |
119 | 120 | say $enumfh 'typedef enum {'; |
120 | 121 | my $cnt = 0; |
121 | 122 | for my $state (@keys, '__CALL') { |
130 | 131 | # Third step: Generate the call function. |
131 | 132 | open(my $callfh, '>', "GENERATED_${prefix}_call.h"); |
132 | 133 | my $resultname = uc(substr($prefix, 0, 1)) . substr($prefix, 1) . 'ResultIR'; |
134 | say $callfh '#pragma once'; | |
133 | 135 | say $callfh "static void GENERATED_call(const int call_identifier, struct $resultname *result) {"; |
134 | 136 | say $callfh ' switch (call_identifier) {'; |
135 | 137 | my $call_id = 0; |
205 | 207 | # Fourth step: Generate the token datastructures. |
206 | 208 | |
207 | 209 | open(my $tokfh, '>', "GENERATED_${prefix}_tokens.h"); |
210 | say $tokfh '#pragma once'; | |
208 | 211 | |
209 | 212 | for my $state (@keys) { |
210 | 213 | my $tokens = $states{$state}; |
9 | 9 | */ |
10 | 10 | #include <config.h> |
11 | 11 | |
12 | #include "libi3.h" | |
13 | ||
12 | 14 | #if defined(__FreeBSD__) |
13 | 15 | #include <sys/param.h> |
14 | 16 | #endif |
22 | 24 | #define _WITH_GETLINE |
23 | 25 | #endif |
24 | 26 | |
25 | #include <stdio.h> | |
26 | #include <sys/types.h> | |
27 | #include <stdlib.h> | |
28 | #include <stdbool.h> | |
29 | #include <unistd.h> | |
30 | #include <string.h> | |
31 | 27 | #include <ctype.h> |
28 | #include <err.h> | |
32 | 29 | #include <errno.h> |
33 | #include <err.h> | |
34 | #include <stdint.h> | |
30 | #include <fcntl.h> | |
35 | 31 | #include <getopt.h> |
36 | 32 | #include <limits.h> |
33 | #include <stdlib.h> | |
34 | #include <string.h> | |
37 | 35 | #include <sys/stat.h> |
38 | #include <fcntl.h> | |
39 | #include <glob.h> | |
40 | #include <assert.h> | |
36 | #include <sys/types.h> | |
37 | #include <unistd.h> | |
41 | 38 | |
42 | 39 | #include <xcb/xcb.h> |
43 | 40 | #include <xcb/xcb_aux.h> |
44 | 41 | #include <xcb/xcb_event.h> |
45 | 42 | #include <xcb/xcb_keysyms.h> |
46 | ||
43 | #include <xkbcommon/xkbcommon-x11.h> | |
47 | 44 | #include <xkbcommon/xkbcommon.h> |
48 | #include <xkbcommon/xkbcommon-x11.h> | |
49 | 45 | |
50 | 46 | #define SN_API_NOT_YET_FROZEN 1 |
51 | 47 | #include <libsn/sn-launchee.h> |
52 | 48 | |
49 | #include <X11/XKBlib.h> | |
53 | 50 | #include <X11/Xlib.h> |
54 | 51 | #include <X11/keysym.h> |
55 | #include <X11/XKBlib.h> | |
56 | 52 | |
57 | 53 | /* We need SYSCONFDIR for the path to the keycode config template, so raise an |
58 | 54 | * error if it’s not defined for whatever reason */ |
68 | 64 | |
69 | 65 | #include "xcb.h" |
70 | 66 | xcb_visualtype_t *visual_type = NULL; |
71 | #include "libi3.h" | |
72 | 67 | |
73 | 68 | #define TEXT_PADDING logical_px(4) |
74 | 69 | #define WIN_POS_X logical_px(490) |
8 | 8 | */ |
9 | 9 | #include <config.h> |
10 | 10 | |
11 | #include "libi3.h" | |
12 | #include "shmlog.h" | |
13 | ||
14 | #include <err.h> | |
15 | #include <fcntl.h> | |
16 | #include <getopt.h> | |
17 | #include <i3/ipc.h> | |
18 | #include <signal.h> | |
19 | #include <stdbool.h> | |
20 | #include <stdint.h> | |
11 | 21 | #include <stdio.h> |
12 | #include <stdbool.h> | |
13 | #include <sys/types.h> | |
14 | #include <sys/socket.h> | |
15 | #include <sys/un.h> | |
16 | 22 | #include <stdlib.h> |
17 | #include <unistd.h> | |
18 | 23 | #include <string.h> |
19 | #include <errno.h> | |
20 | #include <err.h> | |
21 | #include <stdint.h> | |
22 | #include <getopt.h> | |
23 | #include <limits.h> | |
24 | #include <fcntl.h> | |
25 | 24 | #include <sys/mman.h> |
26 | 25 | #include <sys/stat.h> |
27 | #include <signal.h> | |
28 | ||
29 | #include "libi3.h" | |
30 | #include "shmlog.h" | |
31 | #include <i3/ipc.h> | |
26 | #include <unistd.h> | |
32 | 27 | |
33 | 28 | #if !defined(__OpenBSD__) |
34 | 29 | static uint32_t offset_next_write; |
30 | 30 | * This software is in the public domain. Share and enjoy! |
31 | 31 | */ |
32 | 32 | |
33 | #include "keysym2ucs.h" | |
34 | ||
33 | 35 | #include <xcb/xcb.h> |
34 | #include "keysym2ucs.h" | |
35 | 36 | |
36 | 37 | struct codepair { |
37 | 38 | unsigned short keysym; |
7 | 7 | * to i3. |
8 | 8 | * |
9 | 9 | */ |
10 | #include <getopt.h> | |
11 | #include <stdbool.h> | |
12 | #include <stdint.h> | |
10 | 13 | #include <stdio.h> |
14 | #include <stdlib.h> | |
15 | #include <string.h> | |
11 | 16 | #include <sys/types.h> |
12 | #include <stdlib.h> | |
13 | #include <stdbool.h> | |
14 | 17 | #include <unistd.h> |
15 | #include <string.h> | |
16 | #include <errno.h> | |
17 | #include <err.h> | |
18 | #include <stdint.h> | |
19 | #include <getopt.h> | |
20 | #include <limits.h> | |
21 | 18 | |
22 | 19 | #include <xcb/xcb.h> |
23 | 20 | #include <xcb/xcb_aux.h> |
24 | #include <xcb/xcb_event.h> | |
25 | 21 | #include <xcb/xcb_keysyms.h> |
26 | 22 | |
27 | 23 | xcb_visualtype_t *visual_type = NULL; |
24 | #include "i3-input.h" | |
25 | #include "keysym2ucs.h" | |
28 | 26 | #include "libi3.h" |
29 | 27 | |
30 | 28 | #include <X11/keysym.h> |
31 | ||
32 | #include "keysym2ucs.h" | |
33 | ||
34 | #include "i3-input.h" | |
35 | 29 | |
36 | 30 | #define MAX_WIDTH logical_px(500) |
37 | 31 | #define BORDER logical_px(2) |
15 | 15 | */ |
16 | 16 | #include "libi3.h" |
17 | 17 | |
18 | #include <err.h> | |
19 | #include <getopt.h> | |
20 | #include <i3/ipc.h> | |
21 | #include <stdbool.h> | |
22 | #include <stdint.h> | |
18 | 23 | #include <stdio.h> |
19 | #include <stdbool.h> | |
20 | #include <sys/types.h> | |
21 | #include <sys/socket.h> | |
22 | #include <sys/un.h> | |
23 | 24 | #include <stdlib.h> |
25 | #include <string.h> | |
24 | 26 | #include <unistd.h> |
25 | #include <string.h> | |
26 | #include <errno.h> | |
27 | #include <err.h> | |
28 | #include <stdint.h> | |
29 | #include <getopt.h> | |
30 | #include <limits.h> | |
31 | 27 | |
32 | 28 | #include <yajl/yajl_parse.h> |
33 | #include <yajl/yajl_version.h> | |
34 | ||
35 | #include <xcb/xcb.h> | |
36 | #include <xcb/xcb_aux.h> | |
37 | ||
38 | #include <i3/ipc.h> | |
39 | 29 | |
40 | 30 | /* |
41 | 31 | * Having verboselog() and errorlog() is necessary when using libi3. |
0 | #pragma once | |
1 | ||
2 | #include <config.h> | |
3 | ||
4 | #include <err.h> | |
5 | ||
6 | #define die(...) errx(EXIT_FAILURE, __VA_ARGS__); | |
7 | #define FREE(pointer) \ | |
8 | do { \ | |
9 | free(pointer); \ | |
10 | pointer = NULL; \ | |
11 | } while (0) | |
12 | ||
13 | #define xmacro(atom) xcb_atom_t A_##atom; | |
14 | #include "atoms.xmacro" | |
15 | #undef xmacro | |
16 | ||
17 | extern xcb_window_t root; |
7 | 7 | * when the user has an error in their configuration file. |
8 | 8 | * |
9 | 9 | */ |
10 | #include <stdio.h> | |
11 | #include <sys/types.h> | |
12 | #include <sys/stat.h> | |
13 | #include <sys/wait.h> | |
14 | #include <stdlib.h> | |
15 | #include <stdbool.h> | |
16 | #include <unistd.h> | |
17 | #include <string.h> | |
18 | #include <errno.h> | |
10 | #include <config.h> | |
11 | ||
12 | #include "libi3.h" | |
13 | ||
19 | 14 | #include <err.h> |
20 | #include <stdint.h> | |
15 | #include <fcntl.h> | |
21 | 16 | #include <getopt.h> |
22 | 17 | #include <limits.h> |
23 | #include <fcntl.h> | |
24 | 18 | #include <paths.h> |
25 | ||
19 | #include <stdint.h> | |
20 | #include <stdlib.h> | |
21 | #include <string.h> | |
22 | #include <sys/stat.h> | |
23 | #include <sys/types.h> | |
24 | #include <sys/wait.h> | |
25 | #include <unistd.h> | |
26 | ||
27 | #include <xcb/randr.h> | |
26 | 28 | #include <xcb/xcb.h> |
27 | 29 | #include <xcb/xcb_aux.h> |
28 | #include <xcb/xcb_event.h> | |
29 | #include <xcb/randr.h> | |
30 | 30 | #include <xcb/xcb_cursor.h> |
31 | 31 | |
32 | 32 | xcb_visualtype_t *visual_type = NULL; |
33 | #include "libi3.h" | |
34 | 33 | |
35 | 34 | #define SN_API_NOT_YET_FROZEN 1 |
36 | 35 | #include <libsn/sn-launchee.h> |
37 | ||
38 | #include "i3-nagbar.h" | |
39 | 36 | |
40 | 37 | #define MSG_PADDING logical_px(8) |
41 | 38 | #define BTN_PADDING logical_px(3) |
43 | 40 | #define BTN_GAP logical_px(20) |
44 | 41 | #define CLOSE_BTN_GAP logical_px(15) |
45 | 42 | #define BAR_BORDER logical_px(2) |
43 | ||
44 | #define xmacro(atom) xcb_atom_t A_##atom; | |
45 | #include "atoms.xmacro" | |
46 | #undef xmacro | |
47 | ||
48 | #define die(...) errx(EXIT_FAILURE, __VA_ARGS__); | |
46 | 49 | |
47 | 50 | static char *argv0 = NULL; |
48 | 51 | |
313 | 316 | goto free_resources; |
314 | 317 | |
315 | 318 | free_resources: |
316 | FREE(res); | |
317 | FREE(primary); | |
319 | free(res); | |
320 | free(primary); | |
318 | 321 | return result; |
319 | 322 | } |
320 | 323 | |
597 | 600 | free(event); |
598 | 601 | } |
599 | 602 | |
600 | FREE(pattern); | |
603 | free(pattern); | |
601 | 604 | draw_util_surface_free(conn, &bar); |
602 | 605 | |
603 | 606 | return 0; |
8 | 8 | |
9 | 9 | #include <config.h> |
10 | 10 | |
11 | #include <stdbool.h> | |
12 | 11 | #include <xcb/xcb.h> |
13 | 12 | #include <xcb/xproto.h> |
14 | 13 | #include "libi3.h" |
93 | 92 | #include "trayclients.h" |
94 | 93 | #include "xcb.h" |
95 | 94 | #include "configuration.h" |
96 | #include "libi3.h" | |
97 | 95 | #include "parse_json_header.h" |
9 | 9 | #include "common.h" |
10 | 10 | #include "yajl_utils.h" |
11 | 11 | |
12 | #include <err.h> | |
13 | #include <errno.h> | |
14 | #include <ev.h> | |
15 | #include <fcntl.h> | |
16 | #include <paths.h> | |
17 | #include <signal.h> | |
18 | #include <stdarg.h> | |
19 | #include <stdio.h> | |
12 | 20 | #include <stdlib.h> |
21 | #include <string.h> | |
22 | #include <sys/wait.h> | |
13 | 23 | #include <unistd.h> |
14 | #include <sys/types.h> | |
15 | #include <sys/wait.h> | |
16 | #include <signal.h> | |
17 | #include <stdio.h> | |
18 | #include <stdarg.h> | |
19 | #include <fcntl.h> | |
20 | #include <string.h> | |
21 | #include <errno.h> | |
22 | #include <err.h> | |
23 | #include <ev.h> | |
24 | #include <yajl/yajl_common.h> | |
24 | ||
25 | #include <yajl/yajl_gen.h> | |
25 | 26 | #include <yajl/yajl_parse.h> |
26 | #include <yajl/yajl_version.h> | |
27 | #include <yajl/yajl_gen.h> | |
28 | #include <paths.h> | |
29 | ||
30 | #include <xcb/xcb_keysyms.h> | |
31 | 27 | |
32 | 28 | /* Global variables for child_*() */ |
33 | 29 | i3bar_child child; |
8 | 8 | */ |
9 | 9 | #include "common.h" |
10 | 10 | |
11 | #include <stdio.h> | |
12 | #include <stdlib.h> | |
11 | 13 | #include <string.h> |
12 | #include <stdlib.h> | |
13 | #include <stdio.h> | |
14 | #include <errno.h> | |
15 | #include <i3/ipc.h> | |
14 | ||
15 | #include <X11/Xlib.h> | |
16 | 16 | #include <yajl/yajl_parse.h> |
17 | #include <yajl/yajl_version.h> | |
18 | ||
19 | #include <X11/Xlib.h> | |
20 | 17 | |
21 | 18 | config_t config; |
22 | 19 | static char *cur_key; |
8 | 8 | */ |
9 | 9 | #include "common.h" |
10 | 10 | |
11 | #include <errno.h> | |
12 | #include <ev.h> | |
13 | #include <i3/ipc.h> | |
14 | #include <stdint.h> | |
11 | 15 | #include <stdlib.h> |
12 | #include <stdio.h> | |
16 | #include <string.h> | |
13 | 17 | #include <unistd.h> |
14 | #include <stdint.h> | |
15 | #include <string.h> | |
16 | #include <errno.h> | |
17 | #include <sys/socket.h> | |
18 | #include <sys/un.h> | |
19 | #include <i3/ipc.h> | |
20 | #include <ev.h> | |
21 | 18 | #ifdef I3_ASAN_ENABLED |
22 | 19 | #include <sanitizer/lsan_interface.h> |
23 | 20 | #endif |
6 | 6 | */ |
7 | 7 | #include "common.h" |
8 | 8 | |
9 | #include <stdio.h> | |
10 | #include <i3/ipc.h> | |
11 | #include <string.h> | |
12 | #include <unistd.h> | |
13 | #include <stdlib.h> | |
14 | #include <errno.h> | |
15 | 9 | #include <ev.h> |
16 | 10 | #include <getopt.h> |
17 | 11 | #include <glob.h> |
12 | #include <i3/ipc.h> | |
13 | #include <stdio.h> | |
14 | #include <stdlib.h> | |
15 | #include <string.h> | |
18 | 16 | |
19 | 17 | struct ev_loop *main_loop; |
20 | 18 |
8 | 8 | */ |
9 | 9 | #include "common.h" |
10 | 10 | |
11 | #include <stdlib.h> | |
11 | 12 | #include <string.h> |
12 | #include <stdlib.h> | |
13 | #include <stdio.h> | |
14 | #include <errno.h> | |
13 | ||
15 | 14 | #include <yajl/yajl_parse.h> |
16 | #include <yajl/yajl_version.h> | |
17 | 15 | |
18 | 16 | /* A datatype to pass through the callbacks to save the state */ |
19 | 17 | struct mode_json_params { |
8 | 8 | */ |
9 | 9 | #include "common.h" |
10 | 10 | |
11 | #include <errno.h> | |
12 | #include <stdio.h> | |
13 | #include <stdlib.h> | |
11 | 14 | #include <string.h> |
12 | #include <stdlib.h> | |
13 | #include <stdio.h> | |
14 | #include <errno.h> | |
15 | #include <i3/ipc.h> | |
15 | ||
16 | 16 | #include <yajl/yajl_parse.h> |
17 | #include <yajl/yajl_version.h> | |
18 | 17 | |
19 | 18 | /* A datatype to pass through the callbacks to save the state */ |
20 | 19 | struct outputs_json_params { |
9 | 9 | */ |
10 | 10 | #include "common.h" |
11 | 11 | |
12 | #include <stdlib.h> | |
13 | #include <unistd.h> | |
14 | #include <sys/types.h> | |
15 | #include <sys/wait.h> | |
16 | 12 | #include <signal.h> |
17 | #include <stdio.h> | |
18 | #include <fcntl.h> | |
19 | 13 | #include <string.h> |
20 | #include <errno.h> | |
21 | #include <err.h> | |
22 | #include <ev.h> | |
23 | #include <stdbool.h> | |
24 | #include <stdint.h> | |
25 | #include <yajl/yajl_common.h> | |
14 | ||
26 | 15 | #include <yajl/yajl_parse.h> |
27 | #include <yajl/yajl_version.h> | |
28 | 16 | |
29 | 17 | static enum { |
30 | 18 | KEY_VERSION, |
8 | 8 | */ |
9 | 9 | #include "common.h" |
10 | 10 | |
11 | #include <stdlib.h> | |
11 | 12 | #include <string.h> |
12 | #include <stdlib.h> | |
13 | #include <stdio.h> | |
14 | #include <errno.h> | |
13 | ||
15 | 14 | #include <yajl/yajl_parse.h> |
16 | #include <yajl/yajl_version.h> | |
17 | 15 | |
18 | 16 | /* A datatype to pass through the callbacks to save the state */ |
19 | 17 | struct workspaces_json_params { |
8 | 8 | */ |
9 | 9 | #include "common.h" |
10 | 10 | |
11 | #include <xcb/xcb.h> | |
12 | #include <xcb/xkb.h> | |
13 | #include <xcb/xproto.h> | |
11 | #include <err.h> | |
12 | #include <ev.h> | |
13 | #include <i3/ipc.h> | |
14 | #include <stdlib.h> | |
15 | #include <string.h> | |
16 | ||
14 | 17 | #include <xcb/xcb_aux.h> |
15 | 18 | #include <xcb/xcb_cursor.h> |
16 | ||
17 | #include <stdio.h> | |
18 | #include <stdlib.h> | |
19 | #include <unistd.h> | |
20 | #include <fcntl.h> | |
21 | #include <string.h> | |
22 | #include <i3/ipc.h> | |
23 | #include <ev.h> | |
24 | #include <errno.h> | |
25 | #include <limits.h> | |
26 | #include <err.h> | |
27 | ||
28 | #include <X11/Xlib.h> | |
29 | #include <X11/XKBlib.h> | |
30 | #include <X11/extensions/XKB.h> | |
19 | #include <xcb/xkb.h> | |
31 | 20 | |
32 | 21 | #ifdef I3_ASAN_ENABLED |
33 | 22 | #include <sanitizer/lsan_interface.h> |
14 | 14 | #include <config.h> |
15 | 15 | |
16 | 16 | #include <assert.h> |
17 | #include <err.h> | |
18 | #include <errno.h> | |
19 | #include <limits.h> | |
20 | #include <stdarg.h> | |
17 | 21 | #include <stdbool.h> |
22 | #include <stdint.h> | |
23 | #include <stdio.h> | |
18 | 24 | #include <stdlib.h> |
19 | #include <stdio.h> | |
20 | 25 | #include <string.h> |
21 | #include <locale.h> | |
22 | #include <getopt.h> | |
23 | #include <unistd.h> | |
24 | 26 | #include <sys/stat.h> |
25 | 27 | #include <sys/types.h> |
26 | #include <glob.h> | |
27 | #include <errno.h> | |
28 | #include <err.h> | |
29 | #include <stdint.h> | |
30 | #include <inttypes.h> | |
31 | #include <math.h> | |
32 | #include <limits.h> | |
33 | 28 | |
34 | 29 | #include <xcb/xcb.h> |
35 | 30 | #include <xcb/xcb_aux.h> |
31 | #include <xcb/xcb_icccm.h> | |
36 | 32 | #include <xcb/xcb_keysyms.h> |
37 | #include <xcb/xcb_icccm.h> | |
38 | 33 | |
39 | #include <yajl/yajl_gen.h> | |
40 | #include <yajl/yajl_version.h> | |
41 | ||
34 | #include "libi3.h" | |
42 | 35 | #include "data.h" |
43 | 36 | #include "util.h" |
44 | 37 | #include "ipc.h" |
71 | 64 | #include "ewmh.h" |
72 | 65 | #include "assignments.h" |
73 | 66 | #include "regex.h" |
74 | #include "libi3.h" | |
75 | 67 | #include "startup.h" |
76 | 68 | #include "scratchpad.h" |
77 | 69 | #include "commands.h" |
11 | 11 | */ |
12 | 12 | #pragma once |
13 | 13 | |
14 | #include "libi3.h" | |
15 | ||
16 | #include <stdbool.h> | |
17 | 14 | #include "queue.h" |
18 | 15 | #include "i3.h" |
19 | 16 |
8 | 8 | */ |
9 | 9 | #pragma once |
10 | 10 | |
11 | #include "libi3.h" | |
12 | ||
13 | 11 | #define SN_API_NOT_YET_FROZEN 1 |
14 | 12 | #include <libsn/sn-launcher.h> |
15 | 13 | |
16 | 14 | #include <xcb/randr.h> |
17 | #include <stdbool.h> | |
18 | 15 | #include <pcre.h> |
19 | 16 | #include <sys/time.h> |
20 | 17 |
24 | 24 | * floating_windows list of the workspace. |
25 | 25 | * |
26 | 26 | */ |
27 | void floating_enable(Con *con, bool automatic); | |
27 | bool floating_enable(Con *con, bool automatic); | |
28 | 28 | |
29 | 29 | /** |
30 | 30 | * Disables floating mode for the given container by re-attaching the container |
11 | 11 | #include <config.h> |
12 | 12 | |
13 | 13 | #include <ev.h> |
14 | #include <stdbool.h> | |
15 | 14 | #include <yajl/yajl_gen.h> |
16 | 15 | #include <yajl/yajl_parse.h> |
17 | 16 |
9 | 9 | #pragma once |
10 | 10 | |
11 | 11 | #include <config.h> |
12 | ||
13 | #include <stdarg.h> | |
14 | #include <stdbool.h> | |
15 | 12 | |
16 | 13 | /* We will include libi3.h which define its own version of LOG, ELOG. |
17 | 14 | * We want *our* version, so we undef the libi3 one. */ |
11 | 11 | |
12 | 12 | #include <config.h> |
13 | 13 | |
14 | #include <stdint.h> | |
15 | 14 | #if !defined(__OpenBSD__) |
16 | 15 | #include <pthread.h> |
17 | 16 | #endif |
12 | 12 | |
13 | 13 | #include <config.h> |
14 | 14 | |
15 | #include "data.h" | |
16 | ||
17 | 15 | /** |
18 | 16 | * We have just established a connection to the X server and need the initial |
19 | 17 | * Xinerama information to setup workspaces for each screen. |
8 | 8 | |
9 | 9 | #include <math.h> |
10 | 10 | #include <stdlib.h> |
11 | ||
11 | 12 | #include <xcb/xcb_xrm.h> |
12 | 13 | |
13 | 14 | static long dpi; |
8 | 8 | #include "libi3.h" |
9 | 9 | |
10 | 10 | #include <stdlib.h> |
11 | #include <err.h> | |
12 | 11 | #include <string.h> |
12 | ||
13 | 13 | #include <xcb/xcb.h> |
14 | 14 | #include <xcb/xcb_aux.h> |
15 | #include <cairo/cairo-xcb.h> | |
16 | 15 | |
17 | 16 | /* The default visual_type to use if none is specified when creating the surface. Must be defined globally. */ |
18 | 17 | extern xcb_visualtype_t *visual_type; |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | 9 | #include <stdlib.h> |
10 | #include <stdbool.h> | |
11 | 10 | |
12 | 11 | #include <xcb/xcb.h> |
13 | 12 | #include <xcb/xproto.h> |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | 9 | #include <assert.h> |
10 | #include <cairo/cairo-xcb.h> | |
11 | #include <err.h> | |
12 | #include <pango/pangocairo.h> | |
10 | 13 | #include <stdint.h> |
11 | 14 | #include <stdlib.h> |
12 | 15 | #include <string.h> |
13 | #include <stdbool.h> | |
14 | #include <err.h> | |
15 | ||
16 | #include <cairo/cairo-xcb.h> | |
17 | #include <pango/pangocairo.h> | |
18 | 16 | |
19 | 17 | static const i3Font *savedFont = NULL; |
20 | 18 |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | 9 | #include <stdlib.h> |
10 | #include <stdint.h> | |
11 | 10 | #include <string.h> |
12 | 11 | |
13 | 12 | #ifndef CS_STARTS_WITH |
18 | 18 | |
19 | 19 | #include "libi3.h" |
20 | 20 | |
21 | #include <glib.h> | |
21 | 22 | #include <string.h> |
22 | #include <glib.h> | |
23 | 23 | |
24 | 24 | /* Copied from: |
25 | 25 | * https://gitlab.gnome.org/GNOME/glib/blob/f928dfdf57bf92c883b53b16d7a9d49add504f52/glib/gutf8.c#L1752-1815 */ |
5 | 5 | * |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | #include "queue.h" | |
8 | 9 | |
10 | #include <stdint.h> | |
9 | 11 | #include <stdlib.h> |
10 | #include <stdint.h> | |
11 | 12 | #include <string.h> |
12 | ||
13 | #include "queue.h" | |
14 | 13 | struct Colorpixel { |
15 | 14 | char hex[8]; |
16 | 15 | uint32_t pixel; |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <errno.h> | |
10 | #include <stdlib.h> | |
11 | #include <string.h> | |
9 | 12 | #include <unistd.h> |
10 | #include <string.h> | |
11 | #include <stdio.h> | |
12 | #include <limits.h> | |
13 | #include <stdlib.h> | |
14 | #include <errno.h> | |
15 | 13 | |
16 | 14 | /* |
17 | 15 | * This function returns the absolute path to the executable it is running in. |
8 | 8 | |
9 | 9 | #include <stdint.h> |
10 | 10 | #include <stdlib.h> |
11 | ||
11 | 12 | #include <xcb/xcb.h> |
12 | 13 | #include <xcb/xcb_keysyms.h> |
13 | 14 |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <assert.h> | |
10 | #include <stdint.h> | |
9 | #include <err.h> | |
10 | #include <pwd.h> | |
11 | 11 | #include <stdlib.h> |
12 | #include <string.h> | |
13 | #include <stdbool.h> | |
14 | #include <err.h> | |
15 | 12 | #include <sys/stat.h> |
16 | #include <sys/types.h> | |
17 | #include <pwd.h> | |
18 | 13 | #include <unistd.h> |
19 | #include <err.h> | |
20 | 14 | |
21 | 15 | /* |
22 | 16 | * Returns the name of a temporary file with the specified prefix. |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <sys/types.h> | |
9 | #include <err.h> | |
10 | #include <fcntl.h> | |
11 | #include <stdlib.h> | |
12 | #include <string.h> | |
10 | 13 | #include <sys/socket.h> |
11 | 14 | #include <sys/un.h> |
12 | #include <string.h> | |
13 | #include <err.h> | |
14 | #include <stdlib.h> | |
15 | #include <unistd.h> | |
16 | #include <fcntl.h> | |
17 | 15 | |
18 | 16 | /* |
19 | 17 | * Connects to the i3 IPC socket and returns the file descriptor for the |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <errno.h> | |
10 | #include <i3/ipc.h> | |
11 | #include <inttypes.h> | |
12 | #include <stdint.h> | |
9 | 13 | #include <string.h> |
10 | #include <stdlib.h> | |
11 | #include <stdio.h> | |
12 | #include <stdint.h> | |
13 | 14 | #include <unistd.h> |
14 | #include <errno.h> | |
15 | #include <inttypes.h> | |
16 | ||
17 | #include <i3/ipc.h> | |
18 | 15 | |
19 | 16 | /* |
20 | 17 | * Reads a message from the given socket file descriptor and stores its length |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <string.h> | |
10 | #include <stdlib.h> | |
11 | #include <unistd.h> | |
9 | #include <i3/ipc.h> | |
12 | 10 | #include <stdint.h> |
13 | #include <err.h> | |
14 | #include <errno.h> | |
15 | ||
16 | #include <i3/ipc.h> | |
17 | 11 | |
18 | 12 | /* |
19 | 13 | * Formats a message (payload) of the given size and type and sends it to i3 via |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | 9 | #include <string.h> |
10 | #include <stdbool.h> | |
11 | 10 | |
12 | 11 | /* |
13 | 12 | * Returns true if this version of i3 is a debug build (anything which is not a |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <stdio.h> | |
9 | #include <math.h> | |
10 | #include <stdlib.h> | |
10 | 11 | #include <string.h> |
11 | #include <stdbool.h> | |
12 | #include <limits.h> | |
13 | #include <stdlib.h> | |
14 | #include <math.h> | |
15 | 12 | |
16 | 13 | #include <xcb/xcb.h> |
17 | 14 | #include <xcb/xcb_aux.h> |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <string.h> | |
10 | #include <stdlib.h> | |
11 | #include <stdarg.h> | |
12 | #include <unistd.h> | |
13 | #include <stdio.h> | |
14 | 9 | #include <err.h> |
15 | 10 | #include <errno.h> |
11 | #include <stdlib.h> | |
12 | #include <string.h> | |
13 | #include <unistd.h> | |
16 | 14 | |
17 | 15 | /* |
18 | 16 | * The s* functions (safe) are wrappers around malloc, strdup, …, which exits if one of |
10 | 10 | */ |
11 | 11 | #include "libi3.h" |
12 | 12 | |
13 | #include <glib.h> | |
13 | 14 | #include <stdlib.h> |
14 | 15 | #include <string.h> |
15 | ||
16 | #include <glib.h> | |
17 | 16 | |
18 | 17 | struct _i3String { |
19 | 18 | char *utf8; |
6 | 6 | */ |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | #include <sys/types.h> | |
10 | 9 | #include <string.h> |
11 | 10 | |
12 | 11 | #ifndef HAVE_strndup |
7 | 7 | #include "libi3.h" |
8 | 8 | |
9 | 9 | #include <err.h> |
10 | #include <errno.h> | |
11 | 10 | #include <iconv.h> |
12 | 11 | #include <stdlib.h> |
13 | 12 | #include <string.h> |
0 | 0 | #!/bin/zsh |
1 | 1 | # This script is used to prepare a new release of i3. |
2 | 2 | |
3 | export RELEASE_VERSION="4.17" | |
4 | export PREVIOUS_VERSION="4.16" | |
3 | export RELEASE_VERSION="4.19" | |
4 | export PREVIOUS_VERSION="4.18" | |
5 | 5 | export RELEASE_BRANCH="next" |
6 | 6 | |
7 | 7 | if [ ! -e "../i3.github.io" ] |
68 | 68 | |
69 | 69 | echo "Differences in the release tarball file lists:" |
70 | 70 | |
71 | diff -u \ | |
71 | diff --color -u \ | |
72 | 72 | <(tar tf ../i3-${PREVIOUS_VERSION}.tar.bz2 | sed "s,i3-${PREVIOUS_VERSION}/,,g" | sort) \ |
73 | <(tar tf i3-${RELEASE_VERSION}.tar.bz2 | sed "s,i3-${RELEASE_VERSION}/,,g" | sort) \ | |
74 | | colordiff | |
75 | ||
73 | <(tar tf i3-${RELEASE_VERSION}.tar.bz2 | sed "s,i3-${RELEASE_VERSION}/,,g" | sort) | |
76 | 74 | |
77 | 75 | gpg --armor -b i3-${RELEASE_VERSION}.tar.bz2 |
78 | 76 | |
129 | 127 | EOT |
130 | 128 | |
131 | 129 | CONTAINER_NAME=$(echo "i3-${TMPDIR}" | sed 's,/,,g') |
132 | docker build -t i3 . | |
130 | docker build --no-cache -t i3 . | |
133 | 131 | for file in $(docker run --name "${CONTAINER_NAME}" i3 /bin/sh -c "ls /usr/src/i3*_${RELEASE_VERSION}*") |
134 | 132 | do |
135 | 133 | docker cp "${CONTAINER_NAME}:${file}" ${TMPDIR}/debian/ |
7 | 7 | */ |
8 | 8 | #include "all.h" |
9 | 9 | |
10 | #include <math.h> | |
11 | ||
12 | #include <xkbcommon/xkbcommon-x11.h> | |
10 | 13 | #include <xkbcommon/xkbcommon.h> |
11 | #include <xkbcommon/xkbcommon-x11.h> | |
12 | 14 | |
13 | 15 | static struct xkb_context *xkb_context; |
14 | 16 | static struct xkb_keymap *xkb_keymap; |
9 | 9 | #include "all.h" |
10 | 10 | |
11 | 11 | #include <time.h> |
12 | #include <math.h> | |
13 | ||
14 | #include <xcb/xcb_icccm.h> | |
15 | ||
16 | #include <X11/XKBlib.h> | |
17 | 12 | |
18 | 13 | typedef enum { CLICK_BORDER = 0, |
19 | 14 | CLICK_DECORATION = 1, |
7 | 7 | * |
8 | 8 | */ |
9 | 9 | #include "all.h" |
10 | ||
10 | #include "shmlog.h" | |
11 | ||
12 | #include <fcntl.h> | |
11 | 13 | #include <stdint.h> |
12 | #include <float.h> | |
13 | #include <stdarg.h> | |
14 | 14 | #include <unistd.h> |
15 | #include <fcntl.h> | |
16 | ||
17 | #include "shmlog.h" | |
18 | 15 | |
19 | 16 | // Macros to make the YAJL API a bit easier to use. |
20 | 17 | #define y(x, ...) (cmd_output->json_gen != NULL ? yajl_gen_##x(cmd_output->json_gen, ##__VA_ARGS__) : 0) |
23 | 23 | * |
24 | 24 | */ |
25 | 25 | #include "all.h" |
26 | ||
27 | #include <stdio.h> | |
28 | #include <stdlib.h> | |
29 | #include <string.h> | |
30 | #include <unistd.h> | |
31 | #include <stdbool.h> | |
32 | #include <stdint.h> | |
33 | 26 | |
34 | 27 | // Macros to make the YAJL API a bit easier to use. |
35 | 28 | #define y(x, ...) (command_output.json_gen != NULL ? yajl_gen_##x(command_output.json_gen, ##__VA_ARGS__) : 0) |
9 | 9 | * |
10 | 10 | */ |
11 | 11 | #include "all.h" |
12 | ||
13 | 12 | #include "yajl_utils.h" |
14 | 13 | |
15 | 14 | static void con_on_remove_child(Con *con); |
91 | 90 | FREE(mark->name); |
92 | 91 | FREE(mark); |
93 | 92 | } |
93 | DLOG("con %p freed\n", con); | |
94 | 94 | free(con); |
95 | DLOG("con %p freed\n", con); | |
96 | 95 | } |
97 | 96 | |
98 | 97 | static void _con_attach(Con *con, Con *parent, Con *previous, bool ignore_focus) { |
7 | 7 | * |
8 | 8 | */ |
9 | 9 | #include "all.h" |
10 | ||
11 | #include <float.h> | |
12 | #include <stdarg.h> | |
13 | 10 | |
14 | 11 | /******************************************************************************* |
15 | 12 | * Criteria functions. |
24 | 24 | */ |
25 | 25 | #include "all.h" |
26 | 26 | |
27 | #include <fcntl.h> | |
28 | #include <stdbool.h> | |
29 | #include <stdint.h> | |
27 | 30 | #include <stdio.h> |
28 | 31 | #include <stdlib.h> |
29 | 32 | #include <string.h> |
30 | #include <unistd.h> | |
31 | #include <stdbool.h> | |
32 | #include <stdint.h> | |
33 | #include <sys/stat.h> | |
33 | 34 | #include <sys/types.h> |
34 | 35 | #include <sys/wait.h> |
35 | #include <sys/stat.h> | |
36 | #include <fcntl.h> | |
36 | #include <unistd.h> | |
37 | ||
37 | 38 | #include <xcb/xcb_xrm.h> |
38 | 39 | |
39 | 40 | // Macros to make the YAJL API a bit easier to use. |
9 | 9 | */ |
10 | 10 | #include "all.h" |
11 | 11 | |
12 | #include <sys/types.h> | |
13 | #include <sys/stat.h> | |
14 | #include <sys/wait.h> | |
15 | #include <sys/socket.h> | |
16 | #include <sys/un.h> | |
17 | 12 | #include <fcntl.h> |
18 | 13 | #include <time.h> |
14 | #include <unistd.h> | |
19 | 15 | |
20 | 16 | static bool human_readable_key, loaded_config_file_name_key; |
21 | 17 | static char *human_readable_version, *loaded_config_file_name; |
7 | 7 | * |
8 | 8 | */ |
9 | 9 | #include "all.h" |
10 | ||
11 | #include <math.h> | |
10 | 12 | |
11 | 13 | #ifndef MAX |
12 | 14 | #define MAX(x, y) ((x) > (y) ? (x) : (y)) |
220 | 222 | } |
221 | 223 | } |
222 | 224 | |
223 | void floating_enable(Con *con, bool automatic) { | |
225 | bool floating_enable(Con *con, bool automatic) { | |
224 | 226 | bool set_focus = (con == focused); |
225 | 227 | |
226 | 228 | if (con_is_docked(con)) { |
227 | 229 | LOG("Container is a dock window, not enabling floating mode.\n"); |
228 | return; | |
230 | return false; | |
229 | 231 | } |
230 | 232 | |
231 | 233 | if (con_is_floating(con)) { |
232 | 234 | LOG("Container is already in floating mode, not doing anything.\n"); |
233 | return; | |
235 | return false; | |
234 | 236 | } |
235 | 237 | |
236 | 238 | if (con->type == CT_WORKSPACE) { |
237 | 239 | LOG("Container is a workspace, not enabling floating mode.\n"); |
238 | return; | |
240 | return false; | |
239 | 241 | } |
240 | 242 | |
241 | 243 | Con *focus_head_placeholder = NULL; |
418 | 420 | |
419 | 421 | floating_set_hint_atom(nc, true); |
420 | 422 | ipc_send_window_event("floating", con); |
423 | return true; | |
421 | 424 | } |
422 | 425 | |
423 | 426 | void floating_disable(Con *con) { |
9 | 9 | */ |
10 | 10 | #include "all.h" |
11 | 11 | |
12 | #include <sys/time.h> | |
12 | 13 | #include <time.h> |
13 | #include <float.h> | |
14 | #include <sys/time.h> | |
14 | ||
15 | 15 | #include <xcb/randr.h> |
16 | 16 | #define SN_API_NOT_YET_FROZEN 1 |
17 | 17 | #include <libsn/sn-monitor.h> |
840 | 840 | * let's float it and make it sticky. */ |
841 | 841 | DLOG("The window was requested to be visible on all workspaces, making it sticky and floating.\n"); |
842 | 842 | |
843 | floating_enable(con, false); | |
844 | con->floating = FLOATING_AUTO_ON; | |
845 | ||
846 | con->sticky = true; | |
847 | ewmh_update_sticky(con->window->id, true); | |
848 | output_push_sticky_windows(focused); | |
843 | if (floating_enable(con, false)) { | |
844 | con->floating = FLOATING_AUTO_ON; | |
845 | ||
846 | con->sticky = true; | |
847 | ewmh_update_sticky(con->window->id, true); | |
848 | output_push_sticky_windows(focused); | |
849 | } | |
849 | 850 | } else { |
850 | 851 | Con *ws = ewmh_get_workspace_by_index(index); |
851 | 852 | if (ws == NULL) { |
6 | 6 | * ipc.c: UNIX domain socket IPC (initialization, client handling, protocol). |
7 | 7 | * |
8 | 8 | */ |
9 | ||
9 | 10 | #include "all.h" |
10 | ||
11 | 11 | #include "yajl_utils.h" |
12 | 12 | |
13 | #include <ev.h> | |
14 | #include <fcntl.h> | |
15 | #include <libgen.h> | |
16 | #include <locale.h> | |
13 | 17 | #include <stdint.h> |
14 | 18 | #include <sys/socket.h> |
15 | 19 | #include <sys/un.h> |
16 | #include <fcntl.h> | |
17 | #include <libgen.h> | |
18 | #include <ev.h> | |
20 | #include <unistd.h> | |
21 | ||
19 | 22 | #include <yajl/yajl_gen.h> |
20 | 23 | #include <yajl/yajl_parse.h> |
21 | 24 |
9 | 9 | */ |
10 | 10 | #include "all.h" |
11 | 11 | |
12 | #include <yajl/yajl_common.h> | |
13 | #include <yajl/yajl_gen.h> | |
12 | #include <locale.h> | |
13 | ||
14 | 14 | #include <yajl/yajl_parse.h> |
15 | #include <yajl/yajl_version.h> | |
16 | 15 | |
17 | 16 | /* TODO: refactor the whole parsing thing */ |
18 | 17 |
8 | 8 | */ |
9 | 9 | #include <config.h> |
10 | 10 | |
11 | #include "all.h" | |
12 | #include "shmlog.h" | |
13 | ||
14 | #include <errno.h> | |
15 | #include <fcntl.h> | |
11 | 16 | #include <stdarg.h> |
17 | #include <stdbool.h> | |
12 | 18 | #include <stdio.h> |
19 | #include <stdlib.h> | |
13 | 20 | #include <string.h> |
14 | #include <stdbool.h> | |
15 | #include <stdlib.h> | |
21 | #include <sys/mman.h> | |
22 | #include <sys/stat.h> | |
16 | 23 | #include <sys/time.h> |
17 | 24 | #include <unistd.h> |
18 | #include <fcntl.h> | |
19 | #include <sys/mman.h> | |
20 | #include <sys/stat.h> | |
21 | #include <errno.h> | |
22 | 25 | #if !defined(__OpenBSD__) |
23 | 26 | #include <pthread.h> |
24 | 27 | #endif |
25 | ||
26 | #include "util.h" | |
27 | #include "log.h" | |
28 | #include "i3.h" | |
29 | #include "libi3.h" | |
30 | #include "shmlog.h" | |
31 | 28 | |
32 | 29 | #if defined(__APPLE__) |
33 | 30 | #include <sys/sysctl.h> |
7 | 7 | * |
8 | 8 | */ |
9 | 9 | #include "all.h" |
10 | #include "shmlog.h" | |
10 | 11 | |
11 | 12 | #include <ev.h> |
12 | 13 | #include <fcntl.h> |
14 | #include <getopt.h> | |
15 | #include <libgen.h> | |
16 | #include <locale.h> | |
17 | #include <signal.h> | |
18 | #include <sys/mman.h> | |
19 | #include <sys/resource.h> | |
20 | #include <sys/socket.h> | |
21 | #include <sys/stat.h> | |
22 | #include <sys/time.h> | |
13 | 23 | #include <sys/types.h> |
14 | #include <sys/socket.h> | |
15 | 24 | #include <sys/un.h> |
16 | #include <sys/time.h> | |
17 | #include <sys/resource.h> | |
18 | #include <sys/mman.h> | |
19 | #include <sys/stat.h> | |
20 | #include <libgen.h> | |
21 | #include "shmlog.h" | |
25 | #include <unistd.h> | |
22 | 26 | |
23 | 27 | #ifdef I3_ASAN_ENABLED |
24 | 28 | #include <sanitizer/lsan_interface.h> |
7 | 7 | * |
8 | 8 | */ |
9 | 9 | #include "all.h" |
10 | ||
11 | #include "yajl_utils.h" | |
12 | ||
13 | #include <yajl/yajl_gen.h> | |
14 | 10 | |
15 | 11 | /* |
16 | 12 | * Match frame and window depth. This is needed because X will refuse to reparent a |
536 | 532 | * was not specified */ |
537 | 533 | bool automatic_border = (motif_border_style == BS_NORMAL); |
538 | 534 | |
539 | floating_enable(nc, automatic_border); | |
540 | nc->floating = FLOATING_AUTO_ON; | |
535 | if (floating_enable(nc, automatic_border)) { | |
536 | nc->floating = FLOATING_AUTO_ON; | |
537 | } | |
541 | 538 | } |
542 | 539 | |
543 | 540 | /* explicitly set the border width to the default */ |
11 | 11 | #include "all.h" |
12 | 12 | |
13 | 13 | #include <time.h> |
14 | ||
14 | 15 | #include <xcb/randr.h> |
15 | 16 | |
16 | 17 | /* Pointer to the result of the query for primary output */ |
8 | 8 | * |
9 | 9 | */ |
10 | 10 | #include "all.h" |
11 | ||
12 | #include <math.h> | |
11 | 13 | |
12 | 14 | /* Forward declarations */ |
13 | 15 | static int *precalculate_sizes(Con *con, render_params *p); |
27 | 27 | #define _GNU_SOURCE |
28 | 28 | #endif |
29 | 29 | |
30 | #include "sd-daemon.h" | |
31 | ||
32 | #include <errno.h> | |
33 | #include <netinet/in.h> | |
34 | #include <stdarg.h> | |
35 | #include <stddef.h> | |
36 | #include <stdio.h> | |
37 | #include <stdlib.h> | |
38 | #include <string.h> | |
39 | #include <sys/fcntl.h> | |
40 | #include <sys/socket.h> | |
41 | #include <sys/stat.h> | |
30 | 42 | #include <sys/types.h> |
31 | #include <sys/stat.h> | |
32 | #include <sys/socket.h> | |
33 | 43 | #include <sys/un.h> |
34 | #include <sys/fcntl.h> | |
35 | #include <netinet/in.h> | |
36 | #include <stdlib.h> | |
37 | #include <errno.h> | |
38 | 44 | #include <unistd.h> |
39 | #include <string.h> | |
40 | #include <stdarg.h> | |
41 | #include <stdio.h> | |
42 | #include <stddef.h> | |
43 | ||
44 | #include "sd-daemon.h" | |
45 | 45 | |
46 | 46 | int sd_listen_fds(int unset_environment) { |
47 | 47 | int r, fd; |
6 | 6 | */ |
7 | 7 | #include "all.h" |
8 | 8 | |
9 | #include <ev.h> | |
10 | #include <iconv.h> | |
11 | 9 | #include <signal.h> |
12 | 10 | #include <sys/wait.h> |
13 | ||
14 | #include <xcb/xcb_event.h> | |
15 | ||
16 | #include <X11/keysym.h> | |
11 | #include <unistd.h> | |
17 | 12 | |
18 | 13 | typedef struct dialog_t { |
19 | 14 | xcb_window_t id; |
10 | 10 | * |
11 | 11 | */ |
12 | 12 | #include "all.h" |
13 | ||
14 | 13 | #include "sd-daemon.h" |
15 | 14 | |
15 | #include <paths.h> | |
16 | 16 | #include <sys/types.h> |
17 | 17 | #include <sys/wait.h> |
18 | #include <paths.h> | |
18 | #include <unistd.h> | |
19 | 19 | |
20 | 20 | #define SN_API_NOT_YET_FROZEN 1 |
21 | 21 | #include <libsn/sn-launcher.h> |
9 | 9 | */ |
10 | 10 | #include "all.h" |
11 | 11 | |
12 | #include <ctype.h> | |
13 | #include <fcntl.h> | |
14 | #include <inttypes.h> | |
15 | #include <libgen.h> | |
16 | #include <locale.h> | |
12 | 17 | #include <sys/wait.h> |
13 | #include <stdarg.h> | |
18 | #include <unistd.h> | |
14 | 19 | #if defined(__OpenBSD__) |
15 | 20 | #include <sys/cdefs.h> |
16 | 21 | #endif |
17 | #include <fcntl.h> | |
18 | #include <pwd.h> | |
19 | #include <yajl/yajl_version.h> | |
20 | #include <libgen.h> | |
21 | #include <ctype.h> | |
22 | ||
23 | #define SN_API_NOT_YET_FROZEN 1 | |
24 | #include <libsn/sn-launcher.h> | |
25 | 22 | |
26 | 23 | int min(int a, int b) { |
27 | 24 | return (a < b ? a : b); |
7 | 7 | * |
8 | 8 | */ |
9 | 9 | #include "all.h" |
10 | ||
11 | #include <math.h> | |
10 | 12 | |
11 | 13 | /* |
12 | 14 | * Frees an i3Window and all its members. |
8 | 8 | * |
9 | 9 | */ |
10 | 10 | #include "all.h" |
11 | ||
12 | #include <unistd.h> | |
11 | 13 | |
12 | 14 | #ifndef MAX |
13 | 15 | #define MAX(x, y) ((x) > (y) ? (x) : (y)) |
8 | 8 | */ |
9 | 9 | #include <config.h> |
10 | 10 | |
11 | #include "all.h" | |
12 | ||
11 | 13 | #include <assert.h> |
12 | 14 | #include <err.h> |
15 | ||
13 | 16 | #include <xcb/xcb_cursor.h> |
14 | ||
15 | #include "i3.h" | |
16 | #include "xcb.h" | |
17 | #include "xcursor.h" | |
18 | 17 | |
19 | 18 | static xcb_cursor_context_t *ctx; |
20 | 19 | static xcb_cursor_t cursors[XCURSOR_CURSOR_MAX]; |
15 | 15 | |
16 | 16 | #include <ev.h> |
17 | 17 | #include <fcntl.h> |
18 | #include <getopt.h> | |
19 | #include <libgen.h> | |
20 | #include <sys/mman.h> | |
21 | #include <sys/resource.h> | |
22 | #include <sys/socket.h> | |
23 | #include <sys/stat.h> | |
24 | #include <sys/time.h> | |
18 | 25 | #include <sys/types.h> |
19 | #include <sys/socket.h> | |
20 | 26 | #include <sys/un.h> |
21 | #include <sys/time.h> | |
22 | #include <sys/resource.h> | |
23 | #include <sys/mman.h> | |
24 | #include <sys/stat.h> | |
25 | 27 | #include <sys/wait.h> |
26 | #include <libgen.h> | |
28 | #include <unistd.h> | |
27 | 29 | |
28 | 30 | static void uds_connection_cb(EV_P_ ev_io *w, int revents); |
29 | 31 | static void read_client_setup_request_cb(EV_P_ ev_io *w, int revents); |
0 | #!perl | |
1 | # vim:ts=4:sw=4:expandtab | |
2 | # | |
3 | # Please read the following documents before working on tests: | |
4 | # • https://build.i3wm.org/docs/testsuite.html | |
5 | # (or docs/testsuite) | |
6 | # | |
7 | # • https://build.i3wm.org/docs/lib-i3test.html | |
8 | # (alternatively: perldoc ./testcases/lib/i3test.pm) | |
9 | # | |
10 | # • https://build.i3wm.org/docs/ipc.html | |
11 | # (or docs/ipc) | |
12 | # | |
13 | # • http://onyxneon.com/books/modern_perl/modern_perl_a4.pdf | |
14 | # (unless you are already familiar with Perl) | |
15 | # | |
16 | # Verify that _NET_WM_DESKTOP sticky requests do not conflict with dock | |
17 | # clients, resulting in a crash | |
18 | # Ticket: #4039 | |
19 | # Bug still in: 4.18-238-g4d55bba7f | |
20 | use i3test; | |
21 | ||
22 | sub send_sticky_request { | |
23 | my ($win) = @_; | |
24 | ||
25 | my $msg = pack "CCSLLLLLL", | |
26 | X11::XCB::CLIENT_MESSAGE, # response_type | |
27 | 32, # format | |
28 | 0, # sequence | |
29 | $win->id, # window | |
30 | $x->atom(name => '_NET_WM_DESKTOP')->id, # message type | |
31 | hex '0xFFFFFFFF', # data32[0] = NET_WM_DESKTOP_ALL | |
32 | 0, # data32[1] | |
33 | 0, # data32[2] | |
34 | 0, # data32[3] | |
35 | 0; # data32[4] | |
36 | ||
37 | $x->send_event(0, $x->get_root_window(), X11::XCB::EVENT_MASK_SUBSTRUCTURE_REDIRECT, $msg); | |
38 | } | |
39 | ||
40 | # Test the normal functionality first | |
41 | my $ws = fresh_workspace; | |
42 | my $win = open_window; | |
43 | ||
44 | is(@{get_ws($ws)->{floating_nodes}}, 0, 'No floating windows yet'); | |
45 | send_sticky_request($win); | |
46 | sync_with_i3; | |
47 | ||
48 | is(@{get_ws($ws)->{floating_nodes}}, 1, 'One floating (sticky) window'); | |
49 | $ws = fresh_workspace; | |
50 | is(@{get_ws($ws)->{floating_nodes}}, 1, 'Sticky window in new workspace'); | |
51 | ||
52 | # See #4039 | |
53 | kill_all_windows; | |
54 | $win = open_window({ | |
55 | window_type => $x->atom(name => '_NET_WM_WINDOW_TYPE_DOCK') | |
56 | }); | |
57 | ||
58 | send_sticky_request($win); | |
59 | sync_with_i3; | |
60 | is(@{get_ws($ws)->{floating_nodes}}, 0, 'Dock client did not get sticky/floating'); | |
61 | ||
62 | # Cause a ConfigureRequest by setting the window’s position/size. | |
63 | my ($a, $t) = $win->rect; | |
64 | $win->rect(X11::XCB::Rect->new(x => 0, y => 0, width => $a->width, height => $a->height)); | |
65 | ||
66 | does_i3_live; | |
67 | is(@{get_ws($ws)->{floating_nodes}}, 0, 'Dock client still not sticky/floating'); | |
68 | ||
69 | done_testing; |