Commit Graph

298 Commits (d14e59b3a766b17ade2d09afcb5c5d572d85a20c)

Author SHA1 Message Date
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
Peter Boström 9c15b9504e Fix clang -Wextra except -Wunused-parameter.
Cleared all warnings that occur when passing
CFLAGS="-Wall -Wextra -Wno-unused-parameter" to make using clang 3.3 on
Linux x86-64.
2014-01-02 22:15:33 +01:00
Tony Crisci 23b1da598e i3bar: Set `mapped` flag on trayclient creation
When a trayclient is first created as a structure in memory, explicitly
set the `mapped` flag to false. Otherwise it may initialize to `true` in
some circumstances without actually being mapped, causing a request to
be mapped from the client to be ignored.

Create the trayclient in memory before handling a request to be mapped
immediately.

fixes #1138
2014-01-01 11:10:21 +01:00
Tony Crisci 80df764e55 i3bar: Realign tray clients on map/unmap notify
UnmapNotify events are interpreted by i3bar as an action taken by an
application to hide its tray window. Likewise, MapNotify events are
interpreted as an action taken by by an application to show its tray
window.

The actual cause of these events may be the application itself, or the
result of some action taken by i3bar itself at the request of the
application in the course of the XEmbed protocol.

We respond by adjusting the size of the tray window and realigning any
tray clients that remain. This will make room for the mapping window or
close the gap left by the unmapping window when the bar is redrawn.

fixes #1110
2013-11-30 14:01:25 +01:00
Tony Crisci a1e7ce20f0 i3bar: Handle DestroyNotify events
Handle DestroyNotify events by removing the tray client from the tray
client list held in memory.

This change is intended to be part of the i3bar's implementation of the
XEmbed protocol. For more information, see:

<http://standards.freedesktop.org/xembed-spec/xembed-spec-latest.html>

According to the XEmbed protocol specification, this is one way for a
tray client to finish the protocol. After this event is received, i3bar
should have no more interaction with the tray client.
2013-11-24 12:40:03 +01:00
Michael Stapelberg d3beff2339 make i3bar use libi3’s root_atom_contents()
This removes code duplication, which will be useful for a subsequent
commit.

Furthermore, we now don’t open X11 connections unnecessarily in some
corner cases.
2013-11-22 15:48:45 +01:00
Tony Crisci e08215896e i3bar: Simplify hide mode logic
When determining whether to hide or unhide the bar on redraw in hide
mode, use simpler rules. When the config specifies the 'show' state or a
workspace is urgent, or if the caller requests it, or the modifier is
pressed, show the bar. Otherwise, hide the bar.
2013-11-09 14:34:00 +01:00
Tony Crisci cce3c8066a i3bar: Only configure tray on own outputs
If the config specifies a `tray_output` not in the list of outputs over
which this bar will span, do not initialize a tray for the bar.

Fixes former behavior, which was to initialize the tray without showing
the icons, causing disapearing tray icons in multi-monitor environments
when `tray_output` isnt `output`.
2013-10-23 23:23:45 +02:00
syl20bnr 7098ef602b Add new bar.binding_mode_indicator configuration.
i3 current behavior hides the binding mode indicator when
workspace buttons are disabled.
This patch adds a new configuration for i3bar called
'binding_mode_indicator' which acts like the workspace_buttons.
It is now possible to configure i3bar to hide the
workspace buttons and keep showing the binding mode indicator.
This should make the hide workspace buttons configuration
more convenient for those who are heavily using binding
modes.
Default value for binding_mode_indicator is true.
2013-09-24 06:59:26 +02:00
Deiz a7c005848a Create pixmaps using the real bar height, rather than screen height. 2013-09-09 04:36:10 +02:00
Michael Stapelberg 3eea370db2 i3bar: draw workspace buttons at x=0 instead of x=1
This makes the workspace buttons align with the window borders, which is
particularly visible with color configurations like the one in this
screenshot: http://i.imgur.com/CH8srF5.png

fixes #687
2013-07-29 21:50:59 +02:00
haptix@web.de 4937788e8d Fix wrong placement of i3bar when connecting/disconnecting outputs
When connecting or disconnecting an output, i3bar reconfigures its
windows. This also included an unmapping of the bars, and a remapping of
all docked bars. Thus, the bars were misplaced when a monitor was
disconnected.

This commit assures that the remapping of the bars only takes place,
when the mode has actually changed. This patch also takes care of an
inconsistency when pressing the bar_modifier while switching the mode.
Also, the xkbDisplay is now closed correctly, when deregestering the xkb
keyevents.
2013-05-30 12:18:27 +02:00
haptix@web.de e3913093b6 introduced i3 command for changing the hidden state and the mode of i3bar
The hidden_state and mode of each i3bar instance can now be controlled from within i3.
Therefore, two new i3 command were introduced:
    _
    bar hidden_state show|hide|toggle [<bar_id>]

    show: always show the bar
    hide: normal hide mode
    toggle: toggle between show and hide (individually for each bar)
    _
    bar mode dock|hide|invisible|toggle [<bar_id>]

    hide,dock: like before
    invisible: always keep the bar hidden
    toggle: toggle between dock and hide (individually for each bar)

This patch introduces a hidden_state ("hidden_state hide|show") in the
barconfig, which indicates the current hidden_state of each i3bar
instance. It only affects the bar when in hide mode. Additionally, a new
invisible mode was introduced. In order to change the hidden_state or
mode of the bar from i3, a barconfig-update event was introduced, for
which a bar can subscribe and the bar then gets notified about the
currently set hidden_state and mode in its barconfig.

For convenience, an id field ("id <bar_id>") was added to the barconfig, where one can
set the desired id for the corresponding bar. If the id is not specified, i3 will
deterministically choose an id; otherwise, with the previous random approach for finding
a new id, which is actually not shared with i3bar, as it would determine its id on
startup, the event-subscription would be destroyed on reload. Still, this issue remains
when manually changing the bar_id in the config and then reloading.

fixes #833, #651
2013-05-25 23:00:36 +02:00
Thomas Adam ed1d13b0a1 i3bar: Fix pixel offset calculation in dual-head
When running i3bar on a dual-head display with workspaces enabled in i3bar's
config, the second monitor wouldn't use a correct x position offset and
would draw its label too close to the screen's edge.  In comparison to the
first monitor, this is inconsistent because that starts with a pixel offset
of 1.
2013-05-20 15:09:15 +02:00
Michael Stapelberg 8247f44e95 Merge branch 'master' into next 2013-04-14 22:54:36 +02:00
Michael Stapelberg 72c279bc39 Bugfix: fix crash when not having tray_output configured (Thanks Layus) 2013-04-14 22:54:15 +02:00
haptix@web.de 90bfbac107 fix font display height in i3bar
Increase the drawing area height, in order to prevent the font from being cut off.

fixes #992
2013-04-13 19:49:06 +02:00
haptix@web.de a9aad872ee unhide hidden i3bar when mode is active
This patch also handles unhiding of i3bar in case the i3bar modifier key is
pressed for activating a new binding mode.
2013-04-13 10:16:34 +02:00
haptix@web.de 921967c729 unhide hidden i3bar when mode is active
fixes #961
2013-04-11 22:35:54 +02:00
enkore 58e68940f6 Add click events to i3bar
If the statusline generator (i.e. i3status) specifies click_events:true
in the protocol header, i3bar will write a JSON array on it's stdin
notifying it if the user clicks on a block.

The exact protocol is documented in docs/i3bar-protocol.
2013-03-21 23:55:30 +01:00
András Mohari ae0842532e Bugfix: Set separator color properly when drawing
Set the colors in the GC directly since set_font_colors() does not do it
when using a Pango font, resulting in i3bar drawing separators in the
wrong color.
2013-02-25 23:49:15 +01:00
Artem Shinkarov 5f05ca6b5d Separator color via config; separator width and on/off via ipc
This patch adds the following features:
1) Configure a color of the separator via config.  It is done like
   bar {
      colors {
         separator #000000
      }
   }
2) A block can have an integer entry "separator_block_width" which
   sets the width of the gap which would follow after the current block.

3) A block can have a boolean entry "separator" and if it is set
   to false, then the drawing of the separating line would be disabled.
2013-02-18 10:44:44 +01:00
Michael Stapelberg fc3b0db7a5 i3bar: fix rendering positions 2013-01-24 17:21:34 +01:00
Michael Stapelberg 990a1ca4c2 i3bar: don’t use X11 borders to avoid overlapping in hide mode
fixes #923
2013-01-24 16:09:51 +01:00
Michael Stapelberg f2ca568202 i3bar: set _NET_SYSTEM_TRAY_COLORS for symbolic icons (gtk3+) 2013-01-02 23:14:30 +01:00
Michael Stapelberg e9503a1fa3 i3bar: fake DestroyNotify and send MANAGER ClientMessages to fix tray restarts
fixes #745
2013-01-02 23:14:27 +01:00
Michael Stapelberg 2043076518 i3bar: add missing \n to debug messages 2013-01-02 11:38:03 +01:00
Michael Stapelberg 7658109309 Bugfix: remove superfluous #include <xcb/xcb_atom.h> (Thanks pnutzh4x0r)
This fixes the build on CentOS 6.

fixes #889
2012-12-14 21:49:31 +01:00
Antoine Millet e8149c77b3 i3bar: add min_width and align keys to blocks 2012-12-06 09:48:27 +01:00
Pavel Löbl 6148136e7c i3bar: Add current binding mode indicator 2012-11-16 13:44:29 +01:00
Michael Stapelberg b9885ff21e bugfix: don’t send workspace command when at beginning/end of workspaces (Thanks whitequark)
fixes #843
2012-10-14 21:05:44 +02:00
Quentin Glidic 830829922b i3bar: Allow to force unhide with draw_bars 2012-09-22 15:15:57 +02:00
Quentin Glidic 2e5838fb49 i3bar: Rework unhide/hide on workspace urgency
We now check globally for workspace urgency instead of per-output since
the result is the same but we call unhide_bars/hide_bars only once this
way
2012-09-22 15:13:21 +02:00
eeemsi b9255f51f8 Use (void) instead of () for functions without args 2012-08-23 19:34:37 +02:00
Fernando Tarlá Cardoso Lemos edd9007ebf i3bar: Rename xcb_screen to root_screen for consistency 2012-08-13 11:37:34 +02:00
Quentin Glidic 210fc6dfed libi3: Rework predict_text_width
predict_text_width now takes an i3String as argument
2012-08-13 11:37:23 +02:00
Quentin Glidic 53365fa887 libi3: Rework draw_text
We now have two versions of draw_text
draw_text: Now takes an i3String
draw_text_ascii: Designed for static strings in plain ASCII
2012-08-13 11:37:21 +02:00
Quentin Glidic bbd1b16043 i3bar: Port to i3String 2012-08-13 11:30:05 +02:00
darkraven 875130e7e8 Automatically hide i3bar when it's unneeded.
When a workspace marked 'urgent', i3bar unhide
itself. if I want to hide it again, I must press the
modifier.This sometimes annoys me.

In this patch I change the above behavior to this:
If a urgent workspace occurs, i3bar will unhide itself;
and when you navigates away from the last urgent
workspace and there is no more urgent workspace, i3bar
will hide itself.
2012-08-02 01:44:25 +02:00
Marcel Hellwig 3daa3e052f Don't display empty strings from i3status in i3bar 2012-07-11 19:06:02 +02:00
Michael Stapelberg 8a3574f301 i3bar: inform _all_ clients of new tray selection owner
This fixes a problem with X-chat (and possibly others).

Fixes: #745
2012-07-10 22:52:14 +02:00
Michael Stapelberg 599f7cc2a4 i3bar: handle clicks with negative coordinates (Thanks Julian)
This can happen if you move your mouse pointer to the very left of the
screen and then click. For better usability, we handle this edge case
like a click on pixel 0.
2012-06-10 21:04:51 +02:00
TunnelWicht 4f93e0587a don’t wrap when changing workspaces by mouse wheel scrolling 2012-05-09 20:16:02 +02:00
Michael Stapelberg 3a378f7cb1 i3bar: don’t immediately redraw bars after kicking tray clients 2012-04-24 12:04:35 +02:00
Michael Stapelberg 17b477d25d i3bar: when kicking tray clients, remove them immediately
This should fix empty spaces showing up instead of tray icons sometimes.
2012-04-22 20:53:01 +02:00
Michael Stapelberg 78891c1c62 i3bar: when tray_output == primary and there is no primary output, fall back to the first available output 2012-04-22 20:51:15 +02:00
Michael Stapelberg 17e4d7ede1 i3bar: kick tray clients after output configuration changed
This makes i3bar reflect xrandr --output foo --primary changes immediately.
2012-04-22 20:43:52 +02:00
Michael Stapelberg 54222d5617 Merge branch 'master' into next 2012-04-22 20:11:25 +02:00
Michael Stapelberg 97d17f2f5b i3bar: Bugfix: Properly reparent tray clients before killing the bar window when outputs disappear
Fixes: #655
2012-04-22 20:10:29 +02:00
Jose Pereira 9a58c1fcaa Added option to select primary display on tray_output 2012-04-05 14:42:07 +02:00
Michael Stapelberg e7761a342b Merge branch 'master' into next 2012-03-19 21:42:08 +01:00
Michael Stapelberg 8b4ad8c6bd Fix i3bar when using multiple displays (Thanks brimstone) 2012-03-19 21:41:45 +01:00
Michael Stapelberg 31b9d24c2b Implement the i3bar JSON protocol (with fallback to plain text)
If the first line of the input starts with {"version":, then the input is
considered to be JSON, otherwise it is interpreted as plain text.

Only the "full_text" and "color" parts of a block are currently understood by
i3bar.
2012-02-16 23:28:18 +00:00
Michael Stapelberg fd2ff3a6ef Bugfix: insert ending double quote at the right position (Thanks mxf) 2012-02-10 19:55:40 +00:00
Michael Stapelberg 2f8d3d3390 Bugfix: Properly handle workspace names with double quotes (+test) (Thanks kvapen) 2012-02-07 22:50:27 +00:00
Fernando Tarlá Cardoso Lemos 8b29250c32 Fix the text alignment in the workspace indicator.
We now use 5px padding for the workspace text on both sides. Some
fonts will look off-by-one (e.g. fixed), but that's because X core
fonts have padding. This padding is per-char, varies wildly across
different fonts, and would be a major pain to offset for. Even if
we could take this padding into account, this would probably make
things look even worse for some fonts.
2012-01-29 23:08:58 +00:00
Michael Stapelberg 0f360f16ab i3bar: make the ws buttons a bit smaller (like before) and improve the centering 2012-01-29 20:55:54 +00:00
Michael Stapelberg 144be37517 i3bar: correctly check errors when getting the _XEMBED_INFO property
This fixes a problem where starting gnome-settings-daemon (maybe other
programs, too) would leave an empty spot in i3bar’s tray area.
2012-01-28 10:22:43 +00:00
Marcelo Cerri 5a2673d08a Fixed worspace clicking area for i3bar (branch next) 2012-01-28 10:08:14 +00:00
Michael Stapelberg cc8a3c1019 i3bar: make the space between workspace buttons 1 px again 2012-01-28 10:05:51 +00:00
Michael Stapelberg 31b7ec29fd Re-implement bar borders (by Angelo Haller)
This re-introduces borders around the workspace buttons in i3bar.
No additional pixels will be consumed (you will not lose any space for your
windows).
2012-01-20 21:36:50 +00:00
dbp a3081c488a Allow different modifier keys for showing hidden i3bar. 2012-01-08 12:47:41 +00:00
Michael Stapelberg 561cf3719f little style fixes 2011-11-21 21:48:24 +00:00
Fernando Tarlá Cardoso Lemos 344c04af12 Implement set_font_colors.
This paves the way for other font rendering backends. Fonts and
colors shouldn't be specified manually from now on.
2011-11-21 20:52:32 +00:00
Fernando Tarlá Cardoso Lemos 5c2088c87e Enhance libi3 and use it in i3bar.
Abstracted draw_text and predict_text_width into libi3. Use
predict_text_width from libi3 in i3 too. This required tracking
xcb_connection in a xcb_connection_t *conn variable that libi3
expects to be available in i3bar.
2011-11-21 20:52:26 +00:00
Michael Stapelberg 7f9b65f6a7 i3bar: fix event handling
i3bar would only handle one event at a time instead of all pending events.
2011-11-09 23:23:21 +00:00
Michael Stapelberg e85a352fcf i3bar: correctly handle unmapped tray clients, reconfigure tray icons after mapping/unmapping (Thanks IsoLnCHiP)
Fixes #550
2011-11-09 23:22:44 +00:00
Michael Stapelberg ddf261432a i3bar: change default color for active workspace buttons to make them visible
Previously, you could not figure out which workspace is displayed on a screen
which is not focused.
2011-11-07 19:52:21 +00:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg 35bd2d27c0 i3bar: put tray icons in the save-set (prevents them from crashing when i3bar exits/crashes) 2011-10-24 20:11:32 +01:00
Michael Stapelberg 9eda7fb6fb move strndup to libi3 2011-10-23 18:02:01 +01:00
Michael Stapelberg ada4857ad2 Fix colors in i3bar (Thanks julien)
i3bar previously used get_colorpixel on strings without the leading # (ff0000
instead of #ff0000). Since it uses libi3’s get_colorpixel now we needed to
update a few places.
2011-10-23 17:48:44 +01:00
Michael Stapelberg cb9bbcfccf Move get_colorpixel to libi3, use it everywhere else 2011-10-23 17:38:21 +01:00
Michael Stapelberg bc2c63d4ed i3bar: change default font to the i3 default one 2011-10-22 15:00:31 +01:00
Michael Stapelberg 3ee8bd502d i3bar: change default colors to fit the i3 look & feel
The new default looks like this (like in docs/userguide):

	colors {
		background #000000
		statusline #ffffff
		focused_workspace  #ffffff #285577
		active_workspace   #888888 #222222
		inactive_workspace #888888 #222222
		urgent_workspace   #ffffff #900000
	}

If you want to go back to the previous colors, use:

	colors {
		background #000000
		statusline #ffffff
		focused_workspace  #ffffff #480000
		active_workspace   #ffffff #480000
		inactive_workspace #ffffff #240000
		urgent_workspace   #ffffff #002400
	}
2011-10-22 12:34:06 +01:00
Michael Stapelberg 014c3e4b95 i3bar: Bugfix: Don’t crash when tray_output is not set (Thanks fernandotcl) 2011-10-21 23:15:15 +01:00
Michael Stapelberg a3b7ba15ed i3bar: also use the position option when in 'hide' mode 2011-10-21 19:59:25 +01:00
Michael Stapelberg 8a24be9555 i3bar: implement the tray_output option 2011-10-21 19:47:56 +01:00
Michael Stapelberg d71db710dd i3bar: use safewrappers from libi3 2011-10-21 19:30:46 +01:00
Michael Stapelberg a5be27cb79 Make i3bar get its config from i3 via IPC
In order to not duplicate configuration options and make stuff confusing, we
dropped the commandline flags (except for socket_path and bar_id). This means
that you *have to* specify bar_id when starting i3bar. The best way is to let
i3 start i3bar, which it will do automatically for every bar {} configuration
block it finds.
2011-10-19 22:58:19 +01:00
Michael Stapelberg fb4b012013 i3bar: Bugfix: Add tray icon padding when calculating text position (Thanks Bacardi55) 2011-10-10 15:09:39 +01:00
Michael Stapelberg c5e9527abc i3bar: include xcb_compat.h for older XCB versions (Thanks motif) 2011-10-10 11:37:56 +01:00
Michael Stapelberg a70e2057c8 i3bar: set WM_CLASS and WM_NAME 2011-10-09 14:45:23 +01:00
Michael Stapelberg e77f08d1fc i3bar: handle ConfigureRequests for tray children (fixes gtk3 size issue)
Thanks to yvesf for this simple python test script:

    from gi.repository import Gtk as gtk

    def cb(*a):
        print a

    def si_popup(*a):
        print a

    status_icon = gtk.StatusIcon()
    status_icon.set_from_stock(gtk.STOCK_OPEN)
    status_icon.connect("activate", cb)

    gtk.main()
2011-10-09 13:50:46 +01:00
Michael Stapelberg b561b911ee i3bar: add modeline to src/xcb.c 2011-10-09 13:50:39 +01:00
Michael Stapelberg 0c51b57b99 Merge branch 'master' into next 2011-09-19 19:20:18 +01:00
Michael Stapelberg 7064cfc2a0 i3bar: Bugfix: Check if the X11 connection is unavailable
This fixes the condition where the i3 socket for some reason did not produce an
error, but the X server exited (earlier than i3?) and the left-over i3bar
process would consume 100% CPU.

How to reproduce the problem:
1) Start ./testcases/Xdummy :8
2) Start DISPLAY=:8 i3bar -s <socket path to i3 on :0>
3) Kill the Xdummy
2011-09-19 19:17:25 +01:00
Michael Stapelberg eacbf986a0 Merge branch 'master' into next 2011-08-24 18:49:40 +02:00
Michael Stapelberg 7af39906da i3bar: Bugfix: Correctly allocate pixmap for statuslines which are longer than your screen
In case of a 1024 px screen and a 1128 px status line, the status line was not
only cut off (it has to be, obviously), but the right part showed some black
pixels.
2011-08-24 18:48:29 +02:00
Michael Stapelberg 27ade541a9 Initialize output (fixes compiler warning) 2011-08-24 01:34:56 +02:00
Michael Stapelberg 06ba1c0e65 Fix compilation with xcb 0.3.6 2011-08-24 01:18:27 +02:00
Michael Stapelberg 1c2c22d117 i3bar: properly end the XEMBED protocol by reparenting the dock clients to root, flush connection before disconnecting 2011-08-24 01:18:27 +02:00
Michael Stapelberg bd2a3363c0 i3bar: tray: little cleanups, more comments 2011-08-24 01:18:27 +02:00
Michael Stapelberg 55e503c17b i3bar: request the appropriate _NET_SYSTEM_TRAY atom for the display we are running on 2011-08-24 01:18:27 +02:00
Michael Stapelberg 893878cbcc i3bar: send XEMBED_EMBEDDED_NOTIFY after reparenting/mapping tray clients 2011-08-24 01:18:27 +02:00
Michael Stapelberg 737cd10bdf i3bar: properly handle the _XEMBED_INFO property 2011-08-24 01:18:27 +02:00
Michael Stapelberg 7df43989c9 i3bar: correctly handle multiple tray clients 2011-08-24 01:18:27 +02:00
Michael Stapelberg 2046e4112f i3bar: Correctly handle removal of tray clients 2011-08-24 01:18:27 +02:00
Michael Stapelberg 6efa7a754d i3bar: trigger an update after docking a new client 2011-08-24 01:18:27 +02:00
Michael Stapelberg 025dd68f62 i3bar: quick & dirty systray implementation
Works correctly only with exactly one dock client on exactly one output. Maybe
not even then. You have been warned. Proof-of-concept code ;).
2011-08-24 01:18:26 +02:00
Michael Stapelberg dddce72bd7 little comment spelling fixes 2011-08-12 23:09:59 +02:00
Michael Stapelberg 72ef8a7c19 Pass NULL to XkbOpenDisplay, it will read $DISPLAY itself 2011-08-12 23:09:36 +02:00
Michael Stapelberg 3892d616cf Bugfix: Use correct buffer size, quote workspace names
This fixes problems with the workspace 'next' and workspace names longer than
40 characters
2011-08-12 22:57:02 +02:00
Michael Stapelberg fef5a69b09 Mac OS X fixes: include string.h, add strndup(), disable xmllint for the docs 2011-08-01 16:17:59 +02:00
Axel Wagner 8d09ed7bf5 Update changelog and copyright, bump version and more 2011-07-31 16:16:17 +02:00
Axel Wagner ed5ac7f41d Implement disabling the workspace buttons („thx“ sECuRE) 2011-04-21 20:24:02 +02:00
Axel Wagner 26993574f5 Revert "Don't draw on backbuffer, when hiding (thx sECuRE)"
This reverts commit f51ba2d7ecf3f560c8ce4d3ab8419ecf6265839c.

This commit introduced a regression, which prevented i3bar to be redrawn
at all in some circumstances. It will later be reintroduced in a bigger
refactoring of event-dependencies
2011-03-21 17:29:11 +01:00
Axel Wagner ba748d72ff Collapse two ChangeGC-calls (thx sECuRE) 2011-03-20 19:50:03 +01:00
Axel Wagner 52e70c3802 Add Color for focused ws (thx phnom) 2011-03-20 19:29:30 +01:00
Axel Wagner 16f7574851 Bugfix: Skip inactive outputs, when unmapping 2011-03-19 23:28:10 +01:00
Axel Wagner 682458f4d7 Don't draw on backbuffer, when hiding (thx sECuRE) 2011-03-19 23:27:50 +01:00
Axel Wagner 1b2002e1c8 XClearArea can't be used on pixmaps (thx sECuRE) 2011-03-19 23:04:09 +01:00
Axel Wagner a847454a42 bugfix: Skip inactive outputs on redraw (thx sECuRE) 2011-03-19 22:30:59 +01:00
Axel Wagner aaf60c6321 Don't reallocate the backbuffer on every refresh (thx sECuRE) 2011-03-19 22:27:35 +01:00
Axel Wagner 2fd7449e29 Add support for I3_SOCKET_PATH-atom 2011-03-19 22:06:08 +01:00
Axel Wagner d993f8a3a1 Auto-update NUM_ATOMS by putting it into the enum (thx sECuRE) 2011-03-19 20:58:05 +01:00
Axel Wagner 7fb6258fbd Use DISPLAY in XKB-code 2011-03-14 09:20:16 +01:00
Fernando Tarlá Cardoso Lemos c8032d552d Correct minor issues reported by the analyzer.
Found with the Clang Static Analyzer.
2011-02-26 03:03:30 +01:00
Axel Wagner 64f2a7561d Implement dock-positioning 2011-02-21 15:53:32 +01:00
Axel Wagner 23a9814090 Correct typo 2011-02-16 19:53:42 +01:00
Axel Wagner ff925f58e8 Bugfix: Use free-workspaces() in xcb-cleanup (thx dothebart) 2011-01-26 12:57:44 +01:00
Axel Wagner 8fa720d6b9 Bugfix: free() output-names seperately (thx dothebart) 2011-01-26 12:57:38 +01:00
Axel Wagner dc7cfeaa4f Bugfix: Also free() the head of slist/tailq (Thx dothebart) 2011-01-26 01:54:36 +01:00
Axel Wagner d9f35859fa Bugfix: free() text, after drawing it (thx dothebart) 2011-01-26 01:54:36 +01:00
Axel Wagner 9d22b29166 Bugfix: free() workspace-list of outputs seperately (thx dothebart) 2011-01-26 01:54:36 +01:00
Axel Wagner 1369e36d7c Use tree-command for workspace-switching 2011-01-14 19:16:52 +01:00
Axel Wagner 2183435da6 Bugfix: Recreate double-buffers on reconfiguring (thx sECuRE) 2011-01-06 17:28:21 +01:00
Axel Wagner 497a091fbb Use strerror() for more usefull errormessages 2011-01-01 16:55:13 +01:00
Axel Wagner 08a5a2fdb0 Only use font_info after we know, the request succeded 2011-01-01 15:19:17 +01:00