diff --git a/.travis.yml b/.travis.yml index 0133fc71..b56bf684 100644 --- a/.travis.yml +++ b/.travis.yml @@ -31,7 +31,7 @@ install: script: - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-safe-wrappers.sh - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-formatting.sh - - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror"' + - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} /bin/sh -c 'autoreconf -fi && mkdir -p build && cd build && (../configure || (cat config.log; false)) && make -j CFLAGS="-Wformat -Wformat-security -Wextra -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Werror -fno-common"' - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/check-spelling.pl - docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 -e CC ${BASENAME} ./travis/run-tests.sh - ./travis/skip-pkg.sh || docker run -v $PWD:/usr/src/i3/ -w /usr/src/i3 ${BASENAME} ./travis/debian-build.sh deb/debian-amd64/DIST diff --git a/I3_VERSION b/I3_VERSION index f15477ff..7cf2ba0d 100644 --- a/I3_VERSION +++ b/I3_VERSION @@ -1 +1 @@ -4.17.1-non-git +4.18-non-git diff --git a/Makefile.am b/Makefile.am index ee0e038b..59eba84a 100644 --- a/Makefile.am +++ b/Makefile.am @@ -118,7 +118,7 @@ EXTRA_DIST = \ I3_VERSION \ LICENSE \ PACKAGE-MAINTAINER \ - RELEASE-NOTES-4.17.1 \ + RELEASE-NOTES-4.18 \ generate-command-parser.pl \ parser-specs/commands.spec \ parser-specs/config.spec \ @@ -503,6 +503,7 @@ i3_SOURCES = \ include/con.h \ include/data.h \ include/display_version.h \ + include/drag.h \ include/ewmh.h \ include/fake_outputs.h \ include/floating.h \ @@ -548,6 +549,7 @@ i3_SOURCES = \ src/config_directives.c \ src/config_parser.c \ src/display_version.c \ + src/drag.c \ src/ewmh.c \ src/fake_outputs.c \ src/floating.c \ diff --git a/RELEASE-NOTES-4.17.1 b/RELEASE-NOTES-4.17.1 deleted file mode 100644 index 710c4eb8..00000000 --- a/RELEASE-NOTES-4.17.1 +++ /dev/null @@ -1,29 +0,0 @@ - - ┌──────────────────────────────┐ - │ Release notes for i3 v4.17.1 │ - └──────────────────────────────┘ - -This is i3 v4.17.1. This version is considered stable. All users of i3 are -strongly encouraged to upgrade. - -This is a bugfix release for v4.17 - - ┌────────────────────────────┐ - │ Bugfixes │ - └────────────────────────────┘ - - • unset _I3_RESTART_FD after restart (fixes crashes on restart) - • default config: immediately refresh i3status after volume changes - • default config: add XF86AudioMicMute - • default config: mention loginctl lock-session alongside xss-lock - • default config: use workspace number, not just workspace - - ┌────────────────────────────┐ - │ Thanks! │ - └────────────────────────────┘ - -Thanks for testing, bugfixes, discussions and everything I forgot go out to: - - David Shen - --- Michael Stapelberg, 2019-08-30 diff --git a/RELEASE-NOTES-4.18 b/RELEASE-NOTES-4.18 new file mode 100644 index 00000000..4396ee1b --- /dev/null +++ b/RELEASE-NOTES-4.18 @@ -0,0 +1,71 @@ + + ┌────────────────────────────┐ + │ Release notes for i3 v4.18 │ + └────────────────────────────┘ + +This is i3 v4.18. This version is considered stable. All users of i3 are +strongly encouraged to upgrade. + + ┌────────────────────────────┐ + │ Changes in i3 v4.18 │ + └────────────────────────────┘ + + • docs/ipc: document fullscreen_mode in GET_TREE reply + • docs/ipc: document marks field in GET_TREE reply + • docs/ipc: document window_type in GET_TREE reply + • docs/ipc: improve documentation for window_properties + • docs/userguide: clarify commands/config directive wording + • layout saving: remanage window after property updates (e.g. titles) + • get_first_output: prefer primary output (e.g. when moving disabled outputs) + • ipc: add window_type to nodes + • ipc: add container id to nodes + • allow dragging active titles for all container types (e.g. floating+tabbed) + • allow dragging inactive titles after a 10px threshold + • make tray icon order deterministic (sorted by class/instance) + • implement focus next|prev + • implement focus next|prev sibling + • implement focus_wrapping workspace + • exit with exit code 0 on --help + • exec command: respect command criteria + + ┌────────────────────────────┐ + │ Bugfixes │ + └────────────────────────────┘ + + • build: fix lcov support + • build: use AC_REPLACE_FUNCS, drop bundled memmem + • build: fix building with -fno-common (for gcc 10) + • build: configure: deal with git worktree checkouts, where .git is a file + • docs/userguide: fix link to pango markup + • docs/userguide: add missing manipulating_layout anchor + • docs/userguide: fix IPC socket location + • i3-nagbar: make debug log visible + • i3-nagbar: fix small memory leaks + • i3bar: fix small memory leaks + • move workspace to output: don’t create duplicate numbered workspace + • correctly select output when pointer query fails + • fix moving windows to scratchpad when using marks + • fix startup workspace selection when workspace command uses options + • do not try to center floating window on itself (fixes xterm placement) + • fix “move window to ” when target is a workspace + • correctly activate windows behind a fullscreen window + • fix back-and-forth after renaming workspaces + • keep focus when moving container to marked workspace + • do not show scratchpad windows upon move to position command + • reparent windows to their current position when unmanaging + (fixes dock clients unexpectedly moving to different output) + • fix crash when moving containers + • scratchpad_move: un-fullscreen correct container + • avoid crash when nc->window is NULL + + ┌────────────────────────────┐ + │ Thanks! │ + └────────────────────────────┘ + +Thanks for testing, bugfixes, discussions and everything I forgot go out to: + + acheronfail, Albert Safin, Antoine, Benjamin Dopplinger, Brian Ashworth, + Damien Cassou, Daniele Varrazzo, David Shen, Erwin J. van Eijk, Ingo Bürk, + Iskustvo, izzel, Konst Mayer, Orestis Floros, Yury Ignatev + +-- Michael Stapelberg, 2020-02-17 diff --git a/configure.ac b/configure.ac index 22e27f6f..dda93482 100644 --- a/configure.ac +++ b/configure.ac @@ -2,7 +2,7 @@ # Run autoreconf -fi to generate a configure script from this file. AC_PREREQ([2.69]) -AC_INIT([i3], [4.17.1], [https://github.com/i3/i3/issues]) +AC_INIT([i3], [4.18], [https://github.com/i3/i3/issues]) # For AX_EXTEND_SRCDIR AX_ENABLE_BUILDDIR AM_INIT_AUTOMAKE([foreign subdir-objects -Wall no-dist-gzip dist-bzip2]) @@ -29,7 +29,7 @@ AS_VAR_IF([_cv_gnu_make_command], [""], [AC_MSG_ERROR([the i3 Makefile.am requir AX_EXTEND_SRCDIR -AS_IF([test -d ${srcdir}/.git], +AS_IF([test -e ${srcdir}/.git], [ VERSION="$(git -C ${srcdir} describe --tags --abbrev=0)" I3_VERSION="$(git -C ${srcdir} describe --tags --always) ($(git -C ${srcdir} rev-list --format=%cd --date=short -n1 $(git rev-parse HEAD) | tail -n1), branch \\\"$(git -C ${srcdir} describe --tags --always --all | sed s:heads/::)\\\")" @@ -72,7 +72,8 @@ AC_CHECK_TYPES([mode_t, off_t, pid_t, size_t, ssize_t], , [AC_MSG_FAILURE([canno AC_FUNC_FORK AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK AC_FUNC_STRNLEN -AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strndup strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3 requires])]) +AC_CHECK_FUNCS([atexit dup2 ftruncate getcwd gettimeofday localtime_r memchr memset mkdir rmdir setlocale socket strcasecmp strchr strdup strerror strncasecmp strrchr strspn strstr strtol strtoul], , [AC_MSG_FAILURE([cannot find the $ac_func function, which i3 requires])]) +AC_REPLACE_FUNCS([mkdirp strndup]) # Checks for libraries. @@ -83,8 +84,11 @@ AC_SEARCH_LIBS([ev_run], [ev], , [AC_MSG_FAILURE([cannot find the required ev_ru AC_SEARCH_LIBS([shm_open], [rt], [], [], [-pthread]) -AC_SEARCH_LIBS([iconv_open], [iconv], , -AC_SEARCH_LIBS([libiconv_open], [iconv], , [AC_MSG_FAILURE([cannot find the required iconv_open() function despite trying to link with -liconv])])) +AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [iconv_open(0, 0)])], , + [LIBS="-liconv $LIBS" + AC_LINK_IFELSE([AC_LANG_PROGRAM([#include ], [iconv_open(0, 0)])], , + [AC_MSG_FAILURE([cannot find the required iconv_open() function despite trying to link with -liconv])])] +) AX_PTHREAD diff --git a/debian/changelog b/debian/changelog index 9857496d..c5ea756d 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,15 @@ +i3-wm (4.17.2-1) unstable; urgency=medium + + * New upstream release. + + -- Michael Stapelberg Fri, 30 Aug 2019 23:06:40 +0200 + +i3-wm (4.17.1-1) unstable; urgency=medium + + * New upstream release. + + -- Michael Stapelberg Fri, 30 Aug 2019 23:06:40 +0200 + i3-wm (4.17-1) unstable; urgency=medium * New upstream release. diff --git a/docs/i3bar-protocol b/docs/i3bar-protocol index 76c51d80..cadcd8a8 100644 --- a/docs/i3bar-protocol +++ b/docs/i3bar-protocol @@ -189,7 +189,7 @@ separator_block_width:: is 9 pixels), since the separator line is drawn in the middle. markup:: A string that indicates how the text of the block should be parsed. Set to - +"pango"+ to use https://developer.gnome.org/pango/stable/PangoMarkupFormat.html[Pango markup]. + +"pango"+ to use https://developer.gnome.org/pango/stable/pango-Markup.html[Pango markup]. Set to +"none"+ to not use any markup (default). Pango markup only works if you use a pango font. diff --git a/docs/ipc b/docs/ipc index ea7a5892..5bc40e26 100644 --- a/docs/ipc +++ b/docs/ipc @@ -164,6 +164,10 @@ sending a reply. Expect the socket to be shut down. The reply consists of a serialized list of workspaces. Each workspace has the following properties: +id (integer):: + The internal ID (actually a C pointer value) of this container. Do not + make any assumptions about it. You can use it to (re-)identify and + address containers when talking to i3. num (integer):: The logical number of the workspace. Corresponds to the command to switch to this workspace. For named workspaces, this will be -1. @@ -344,12 +348,19 @@ window (integer):: containers. This ID corresponds to what xwininfo(1) and other X11-related tools display (usually in hex). window_properties (map):: - X11 window properties title, instance, class, window_role and transient_for. + This optional field contains all available X11 window properties from the + following list: *title*, *instance*, *class*, *window_role* and *transient_for*. +window_type (string):: + The window type (_NET_WM_WINDOW_TYPE). Possible values are undefined, normal, + dialog, utility, toolbar, splash, menu, dropdown_menu, popup_menu, tooltip and + notification. urgent (bool):: Whether this container (window, split container, floating container or workspace) has the urgency hint set, directly or indirectly. All parent containers up until the workspace container will be marked urgent if they have at least one urgent child. +marks (array of string):: + List of marks assigned to container focused (bool):: Whether this container is currently focused. focus (array of integer):: @@ -357,6 +368,14 @@ focus (array of integer):: order. Traversing the tree by following the first entry in this array will result in eventually reaching the one node with +focused+ set to true. +fullscreen_mode (integer):: + Whether this container is in fullscreen state or not. + Possible values are + +0+ (no fullscreen), + +1+ (fullscreened on output) or + +2+ (fullscreened globally). + Note that all workspaces are considered fullscreened on their respective output. + nodes (array of node):: The tiling (i.e. non-floating) child containers of this node. floating_nodes (array of node):: diff --git a/docs/layout-saving b/docs/layout-saving index f31b5e21..4f0ffccf 100644 --- a/docs/layout-saving +++ b/docs/layout-saving @@ -261,27 +261,3 @@ container: ] } -------------------------------------------------------------------------------- - -=== Placeholders using window title matches don't swallow the window - -If you use the +title+ attribute to match a window and find that it doesn't -work or only works sometimes, the reason might be that the application sets the -title only after making the window visible. This will be especially true for -programs running inside terminal emulators, e.g., +urxvt -e irssi+ when -matching on +title: "irssi"+. - -One way to deal with this is to not rely on the title, but instead use, e.g., -the +instance+ attribute and running the program to set this window instance to -that value: - --------------------------------------------------------------------------------- -# Run irssi via -# urxvt -name "irssi-container" -e irssi - -"swallows": [ - { - "class": "URxvt", - "instance": "irssi-container" - } -] --------------------------------------------------------------------------------- diff --git a/docs/userguide b/docs/userguide index 0fda7e80..36c7abb7 100644 --- a/docs/userguide +++ b/docs/userguide @@ -680,8 +680,8 @@ for_window [class="urxvt"] border pixel 1 for_window [title="x200: ~/work"] floating enable ------------------------------------------------ -The valid criteria are the same as those for commands, see <>. Only config -directives with a command equivalent can be executed at runtime, see <>. +The valid criteria are the same as those for commands, see <>. Only +commands can be executed at runtime, not config directives, see <>. [[no_focus]] === Don't focus window upon opening @@ -1005,7 +1005,8 @@ programs to get information from i3, such as the current workspaces (to display a workspace bar), and to control i3. The IPC socket is enabled by default and will be created in -+/tmp/i3-%u.XXXXXX/ipc-socket.%p+ where +%u+ is your UNIX username, +%p+ is ++$XDG_RUNTIME_DIR/i3/ipc-socket.%p+ if the directory is available, falling back +to +/tmp/i3-%u.XXXXXX/ipc-socket.%p+, where +%u+ is your UNIX username, +%p+ is the PID of i3 and XXXXXX is a string of random characters from the portable filename character set (see mkdtemp(3)). @@ -1105,9 +1106,14 @@ If you want the focus to *always* wrap and you are aware of using +focus parent+ to switch to different containers, you can instead set +focus_wrapping+ to the value +force+. +To restrict focus inside the current workspace set +focus_wrapping+ to the +value +workspace+. You will need to use +focus parent+ until a workspace is +selected to switch to a different workspace using the focus commands (the ++workspace+ command will still work as expected). + *Syntax*: --------------------------- -focus_wrapping yes|no|force +focus_wrapping yes|no|force|workspace # Legacy syntax, equivalent to "focus_wrapping force" force_focus_wrapping yes @@ -1625,6 +1631,35 @@ bar { } ------------------------ +=== Minimal width for workspace buttons + +By default, the width a workspace button is determined by the width of the text +showing the workspace name. If the name is too short (say, one letter), then the +workspace button may look too small. + +This option specifies the minimum width for workspace buttons. If the name of +a workspace is too short to cover the button, an additional padding is added on +both sides of the button so that the text is centered. + +The default value of zero means that no additional padding is added. + +The setting also applies to the current binding mode indicator. + +Note that the specified pixels refer to logical pixels, which may translate +into more pixels on HiDPI displays. + +*Syntax*: +------------------------ +workspace_min_width [px] +------------------------ + +*Example*: +------------------------ +bar { + workspace_min_width 40 +} +------------------------ + === Strip workspace numbers/name Specifies whether workspace numbers should be displayed within the workspace @@ -1867,9 +1902,6 @@ The criteria +class+, +instance+, +role+, +title+, +workspace+ and +mark+ are actually regular expressions (PCRE). See +pcresyntax(3)+ or +perldoc perlre+ for information on how to use them. -Note that config directives listed under <> cannot be changed at runtime -unless they happen to have a command equivalent. - [[exec]] === Executing applications (exec) @@ -1954,6 +1986,7 @@ bindsym $mod+h split horizontal bindsym $mod+t split toggle ------------------------------- +[[manipulating_layout]] === Manipulating layout Use +layout toggle split+, +layout stacking+, +layout tabbed+, +layout splitv+ @@ -2024,6 +2057,12 @@ parent:: child:: The opposite of +focus parent+, sets the focus to the last focused child container. +next|prev:: + Automatically sets focus to the adjacent container. If +sibling+ is + specified, the command will focus the exact sibling container, + including non-leaf containers like split containers. Otherwise, it is + an automatic version of +focus left|right|up|down+ in the orientation + of the parent container. floating:: Sets focus to the last focused floating container. tiling:: @@ -2039,6 +2078,7 @@ output:: focus focus left|right|down|up focus parent|child|floating|tiling|mode_toggle +focus next|prev [sibling] focus output left|right|up|down|primary| ---------------------------------------------- @@ -2198,7 +2238,7 @@ See <> for how to move a container/workspace to a different RandR output. Workspace names are parsed as -https://developer.gnome.org/pango/stable/PangoMarkupFormat.html[Pango markup] +https://developer.gnome.org/pango/stable/pango-Markup.html[Pango markup] by i3bar. [[back_and_forth]] @@ -2492,7 +2532,7 @@ unmark irssi By default, i3 will simply print the X11 window title. Using +title_format+, this can be customized by setting the format to the desired output. This directive supports -https://developer.gnome.org/pango/stable/PangoMarkupFormat.html[Pango markup] +https://developer.gnome.org/pango/stable/pango-Markup.html[Pango markup] and the following placeholders which will be replaced: +%title+:: diff --git a/i3-config-wizard/main.c b/i3-config-wizard/main.c index 7c1f00a3..f999de30 100644 --- a/i3-config-wizard/main.c +++ b/i3-config-wizard/main.c @@ -68,6 +68,7 @@ } while (0) #include "xcb.h" +xcb_visualtype_t *visual_type = NULL; #include "libi3.h" #define TEXT_PADDING logical_px(4) diff --git a/i3-input/main.c b/i3-input/main.c index f15a74ab..e495fe10 100644 --- a/i3-input/main.c +++ b/i3-input/main.c @@ -8,8 +8,6 @@ * to i3. * */ -#include "libi3.h" - #include #include #include @@ -27,6 +25,9 @@ #include #include +xcb_visualtype_t *visual_type = NULL; +#include "libi3.h" + #include #include "keysym2ucs.h" diff --git a/i3-nagbar/main.c b/i3-nagbar/main.c index ec3e25fb..5099cf54 100644 --- a/i3-nagbar/main.c +++ b/i3-nagbar/main.c @@ -8,8 +8,6 @@ * when the user has an error in their configuration file. * */ -#include "libi3.h" - #include #include #include @@ -32,6 +30,9 @@ #include #include +xcb_visualtype_t *visual_type = NULL; +#include "libi3.h" + #define SN_API_NOT_YET_FROZEN 1 #include @@ -87,7 +88,7 @@ void verboselog(char *fmt, ...) { va_list args; va_start(args, fmt); - vfprintf(stdout, fmt, args); + vfprintf(stderr, fmt, args); va_end(args); } @@ -282,11 +283,12 @@ static xcb_rectangle_t get_window_position(void) { xcb_randr_get_screen_resources_current_reply_t *res = NULL; if ((primary = xcb_randr_get_output_primary_reply(conn, pcookie, NULL)) == NULL) { - DLOG("Could not determine the primary output.\n"); + LOG("Could not determine the primary output.\n"); goto free_resources; } if ((res = xcb_randr_get_screen_resources_current_reply(conn, rcookie, NULL)) == NULL) { + LOG("Could not query screen resources.\n"); goto free_resources; } @@ -294,20 +296,24 @@ static xcb_rectangle_t get_window_position(void) { xcb_randr_get_output_info_reply(conn, xcb_randr_get_output_info(conn, primary->output, res->config_timestamp), NULL); - if (output == NULL || output->crtc == XCB_NONE) + if (output == NULL || output->crtc == XCB_NONE) { + LOG("Could not query primary screen.\n"); goto free_resources; + } xcb_randr_get_crtc_info_reply_t *crtc = xcb_randr_get_crtc_info_reply(conn, xcb_randr_get_crtc_info(conn, output->crtc, res->config_timestamp), NULL); - if (crtc == NULL) + if (crtc == NULL) { + LOG("Could not get CRTC.\n"); goto free_resources; + } - DLOG("Found primary output on position x = %i / y = %i / w = %i / h = %i.\n", - crtc->x, crtc->y, crtc->width, crtc->height); + LOG("Found primary output on position x = %i / y = %i / w = %i / h = %i.\n", + crtc->x, crtc->y, crtc->width, crtc->height); if (crtc->width == 0 || crtc->height == 0) { - DLOG("Primary output is not active, ignoring it.\n"); + LOG("Primary output is not active, ignoring it.\n"); goto free_resources; } @@ -379,10 +385,11 @@ int main(int argc, char *argv[]) { while ((o = getopt_long(argc, argv, options_string, long_options, &option_index)) != -1) { switch (o) { case 'v': + free(pattern); printf("i3-nagbar " I3_VERSION "\n"); return 0; case 'f': - FREE(pattern); + free(pattern); pattern = sstrdup(optarg); break; case 'm': @@ -393,6 +400,7 @@ int main(int argc, char *argv[]) { bar_type = (strcasecmp(optarg, "warning") == 0 ? TYPE_WARNING : TYPE_ERROR); break; case 'h': + free(pattern); printf("i3-nagbar " I3_VERSION "\n"); printf("i3-nagbar [-m ] [-b