Commit Graph

226 Commits (9b691bcca28926cc8e5da47a77b68dae334cfe52)

Author SHA1 Message Date
Ingo Bürk 9b691bcca2 Introduce a config directive 'binding_mode' in the 'bar' config, pass it through the IPC and parse it in i3bar. 2015-05-31 16:49:09 +02:00
Michael Hofmann 27c060b279 Tray icon size cleanup.
- icon_size instead of font.height
- consistent spacing with tray_spacing_px
2015-04-30 11:45:38 +02:00
Michael Stapelberg 5dda3bc2ae Merge pull request #1657 from Georgiy-Tugai/fix-flickering-shortened
i3bar: fix flickering shortened status bar on other output(s)
2015-04-26 23:38:27 +02:00
Ingo Bürk bbc66e45f7 Only detect clicks within the statusline width.
If the user clicks on the very top of i3bar above a tray icon, i3bar might
mistakenly trigger the click event for the last status block. This is due to
the fact that the click detection considers the separator width of the block
even though on the last block this is ignored, incorrectly spanning the block's
width partially (or entirely) across the tray area.
2015-04-26 00:32:18 +02:00
Georgiy Tugai de866c2fea
i3bar: fix flickering shortened status bar on other output(s) 2015-04-21 12:28:43 +09:30
Deiz 884214f14f Update copyright notices and get rid of ranges
The script used to make these changes can be found at:

   https://gist.github.com/Deiz/32322020f76d23e2bf8f
2015-04-20 17:50:21 -04:00
Ingo Bürk a952ae74f4 Use a reasonable default sep_block_width if a separator_symbol is given 2015-04-03 22:54:59 +02:00
Michael Stapelberg 6b04f28b48 fix remaining warnings 2015-03-29 17:12:20 +02:00
Michael Stapelberg fb0573e183 Merge pull request #1582 from shdown/allow-escaping-backslashes
Allow escaping backslashes
2015-03-27 09:40:09 +01:00
Tony Crisci 3f3b2d9a3f i3bar: reconfigure strut partial on reload
Strut partial tells i3 where to reserve space for i3bar. It is affected
by the `position` bar config directive.
2015-03-25 19:17:06 -04:00
Michael Stapelberg 037cb317cb Merge pull request #1578 from Airblader/feature-custom-separator
Add support for a custom separator symbol
2015-03-25 22:49:09 +01:00
Ingo Bürk 80da100ac8 Add support for a custom separator symbol
This introduces a "separator_symbol" property for the i3bar configuration.
If set, the specified string will be used as a separator instead of a vertical line. Since it is an optional configuration, complete backwards compatibility is given.

fixes #1472
2015-03-25 21:38:55 +01:00
Michael Stapelberg bbb035d975 Merge pull request #1583 from shdown/next
i3bar: spelling fixes (2)
2015-03-25 20:16:00 +01:00
shdown 6d8891894e Allow escaping backslashes
Fixes #1577.
2015-03-25 21:32:46 +03:00
shdown 6922a820a6 i3bar: spelling fixes (2) 2015-03-24 15:41:16 +03:00
Michael Stapelberg ff62a68c1e Merge pull request #1570 from shdown/next
i3bar: spelling fixes
2015-03-23 22:10:17 +01:00
shdown e8704bb33b i3bar: spelling fixes 2015-03-23 22:56:49 +03:00
Ingo Bürk c9019ada4e Add support for short_text
When the statusline is too long, try to use the short_text property of each status block before falling back to truncating it.
fixes #1092
2015-03-23 11:24:30 +01:00
Michael Stapelberg 8d0fb482d9 clang-format and rearrange comments in i3bar/src/xcb.c 2015-03-23 09:23:01 +01:00
Michael Stapelberg 33fa3284db Merge pull request #1560 from shdown/refactoring
i3bar: refactoring
2015-03-22 21:29:03 +01:00
shdown f19fa0e3c9 i3bar: introduce get_tray_width() function to reduce duplication 2015-03-22 13:28:00 +03:00
shdown 62e4caa06c i3bar: refactor magic numbers to *_px constants 2015-03-22 13:28:00 +03:00
Michael Stapelberg 9493b61bb4 i3bar: set correct initial position when reconfiguring
fixes #1542
2015-03-21 22:50:48 +01:00
shdown b2309b8681 i3bar: fix click events for workspace buttons with long statusline
This combines detecting of current and clicked workspaces into one cycle
and then checks if the x coordinate of the clicked point is greater than
the workspace buttons width.
2015-03-21 19:41:38 +03:00
shdown b1c7c7eea4 i3bar: fix spelling is messages 2015-03-21 19:22:31 +03:00
shdown 4d3867f178 i3bar: rename a variable
Give it a more meaningful name.
2015-03-21 19:17:05 +03:00
shdown b28bb20caa i3bar: add binding indicator width to workspace buttons width
Just to prevent the indicator from being overlapped by the statusline.
2015-03-21 19:12:29 +03:00
shdown ccd6ae8eaf i3bar: cut long statuslines from the left
This draws the statusline after drawing (and calculating width of) the
workspace buttons and fixes calculation of its maximum visible width.
This (hopefully) guarantees that these two will never overlap.
2015-03-21 19:08:40 +03:00
shdown 5efcfda2ed i3bar: fix clearing of the statusline pixmap
This fixes the bug when statusline pixmap wasn't entirely cleared that
caused random artifacts to appear when the statusline width is greater
than the screen width.
2015-03-21 19:00:11 +03:00
Michael Stapelberg 091f1db39a run clang-format (3.5.0)
Not quite sure why there are so many differences. Perhaps we’ve gotten
out of the habit of running clang-format after every change.

I guess it’d be best to have a travis hook that runs clang-format for us
and reports any problems on pull requests.
2015-03-01 17:16:03 +01:00
Michael Stapelberg db62b5a4df Merge branch 'master' into next 2015-02-11 21:08:00 +01:00
Ingo Bürk 594b29f83d Make click events on status blocks work if 'workspace_buttons no' is set.
1. Always subscribe to click events for i3bar.
2. Exit the click event handler if no current workspace was found only after clicks on status blocks have been handled.

fixes #1430
2015-02-11 20:34:43 +01:00
Ingo Bürk d75f80402a Correctly calculate clicks on i3bar status blocks
fixes #1458
2015-02-10 14:52:53 +01:00
Alexander Monakov f28ce227e3 i3bar: suspend the child when bars are fully obscured 2015-01-25 20:31:38 +01:00
Ingo Bürk 13850a55b0 Inset the urgent background of a status block for consistency with workspace buttons.
fixes #1423
2015-01-17 18:28:14 +01:00
Ingo Bürk 8ea67d0488 i3bar: Respect the urgency flag on status blocks
…by drawing urgent blocks with the same settings as an urgent workspace.

(Also use logical_px() and bar_height.)

fixes #682
2014-12-09 11:23:46 +01:00
Michael Stapelberg cc09348414 Merge branch 'master' into next 2014-07-24 10:11:34 +02:00
Michael Stapelberg 4699c714b3 Bugfix: add a sync call to i3bar to confirm reparents before exiting
Without this call, sometimes the tray icon windows are reparented into
i3’s container around the i3bar window, i.e. into the next remaining
window in the window hierarchy. Since i3 then closes that container
(since the i3bar window itself was closed), the tray window will also
get closed. In general, this weird interaction (getting reparented and
then closed) is not well received by tray icon providers :).

closes: #1296
2014-07-24 10:09:53 +02:00
Tony Crisci 8e23dc881b i3bar: implement custom mouse wheel commands
Users can specify a command to run when a button was pressed on i3bar to
override the default behavior. Currently only the mouse wheel buttons
are supported. This is useful for disabling the scroll wheel action or
running scripts that implement custom behavior for these buttons.

Example:

bar {
    wheel_up_cmd nop
    wheel_down_cmd exec ~/.i3/scripts/custom_wheel_down
}

fixes #1104
2014-07-10 22:40:12 +02:00
Michael Stapelberg 3f5a0f0024 Switch to xcb-xkb and libxkbcommon
This removes our last dependency on Xlib! :)

(Okay, an Xlib dependency still comes in through other libraries that we
 link against, but it’s not us. Our code is simpler by this change and
 uses one less connection to X11.)
2014-06-21 19:10:37 +02:00
Michael Stapelberg 4c06e7a573 clang-format-3.5 **/*.h **/*.c
This should be the last commit that formats a big bunch of files. From
here on, whenever I merge patches, I’ll run clang-format like described
in the title.
2014-06-19 11:20:32 +02:00
Michael Stapelberg 9200094203 format **/*.c with clang-format-3.5
This has multiple effects:

1) The i3 codebase is now consistently formatted. clang-format uncovered
   plenty of places where inconsistent code made it into our code base.

2) When writing code, you don’t need to think or worry about our coding
   style. Write it in yours, then run clang-format-3.5

3) When submitting patches, we don’t need to argue about coding style.

The basic idea is that we don’t want to care about _how_ we write the
code, but _what_ it does :). The coding style that we use is defined in
the .clang-format config file and is based on the google style, but
adapted in such a way that the number of modifications to the i3 code
base is minimal.
2014-06-15 19:07:02 +02:00
Tony Crisci e707e0a5fa i3bar: implement custom workspace numbers config
Implement the configuration option within the bar config directive for
custom workspace numbers with the directive `strip_workspace_numbers
yes`.

This directive strips the workspace name of the number prefix and
delimiter. When the workspace name consists only of the number, it will
default to show the number.

For example:

* "2:5" -> "5"
* "4:$" -> "$"
* "8" -> "8"

This allows customization of i3bar for alternate ordering of workspaces
which has a legitimate use for alternate keyboard layouts such as
Dvorak.

fixes #1131
2014-05-16 17:55:30 +02:00
Tony Crisci ab0fae400b Delegate click handling to dock clients
Do not handle click events on dock clients because they are not managed
windows. Dock clients are responsible for sending the message to i3 to
focus a workspace if that is appropriate. i3bar now sends the message to
focus the correct workspace when that is appropriate.

Otherwise, it could interfere with the dock clients own click handling,
which could be an action to focus a different workspace than i3 had
assumed, such as would be the case with a workspace widget.
2014-04-30 09:31:42 +02:00
Michael Stapelberg 350e2c5f55 do click handling and tray padding retina-correctly 2014-04-26 17:30:27 +02:00
Michael Stapelberg 9686dd4943 draw workspace buttons and padded text blocks retina-correctly 2014-04-26 17:27:57 +02:00
Michael Stapelberg 87110a87a8 i3bar: render separators retina-correctly 2014-04-26 17:20:21 +02:00
Quentin Glidic eb7537e53d i3bar: Send mouse wheel events to child too
Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
2014-03-21 19:30:17 +01:00
Michael Stapelberg f891a8a9af i3bar: fix resource leak: statusline_ctx needs to be freed first
In practice this is rarely noticeable, unless you very often switch
screen resolutions, I think.

fixes #1172
2014-02-02 11:24:17 +01:00
Peter Boström f78c1ba053 Fix 'gcc -Wextra -Wno-unused-parameter'. 2014-01-04 20:43:30 +01:00