Commit Graph

46 Commits

Author SHA1 Message Date
Michael Stapelberg e2f47ef466 i3-input: fix (irrelevant) memory leak
Given that the code was exit(0)ing directly after using that memory,
it’s not like this has any effect. However, less false positives on the
clang-analyze report pages is a good thing.
2014-05-15 23:50:09 +02:00
Michael Stapelberg 0883dfbe14 only LOG() the DPI when it changes, DLOG() it otherwise (Thanks lkraav)
This avoids flooding stdout every time some text (e.g. a window
decoration) is drawn, yet leaves the message in place when it’s actually
relevant (upon DPI changes).

fixes #1115
2013-12-24 10:35:56 +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
Michael Stapelberg 28933f8de3 i3-input: set focus before sending the command (Thanks emias)
This avoids problems with sending 'focus left' or other commands which
manipulate focus.
2013-01-24 13:57:08 +01:00
Michael Stapelberg 5779f573e7 i3-input: restore input focus on exit() (Thanks f8l)
fixes #641
2012-12-19 18:22:03 +01:00
Oliver Kiddle f7d825062a remove superfluous ev.h include statements 2012-09-20 11:15:17 +02:00
Quentin Glidic a007283773 i3-input: Fix text drawing offset 2012-08-28 12:06:03 +02:00
Quentin Glidic af15087b99 i3-input: Do not use a non-loaded font
We must call load_font before any font-related calls like
predict_text_width
2012-08-28 10:58:18 +02:00
Michael Stapelberg 2896ae8057 logging: make libi3 use verboselog()/errorlog(), provide it in each caller
While this is a bit ugly, it makes the log messages end up where they
are supposed to: in the shmlog/stdout in case of i3 and on stdout in
case of utilities such as i3-input
2012-08-13 13:27:16 +02:00
Fernando Tarlá Cardoso Lemos 6ff3f7abad libi3: Implement Pango rendering 2012-08-13 11:39:30 +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 284294e9c2 i3-input: Store and use xcb_char2b_t directly 2012-08-13 11:30:08 +02:00
Quentin Glidic d89cb04c98 i3-input: Port prompt to i3String 2012-08-13 11:30:08 +02:00
Michael Stapelberg 8a1c8115ca fix a few warnings/places where the clang static analyzer complains 2012-08-05 16:34:38 +02:00
Michael Stapelberg dee7c07ad2 shmlog: store meta information in the buffer itself, store path as X11 atom
This makes i3-dump-log completely independent of a running i3 instance.
2012-01-06 23:40:07 +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 eafc7af606 Make all programs use draw_text. 2011-11-21 20:52:29 +00:00
Fernando Tarlá Cardoso Lemos fb11cc2d14 Consolidate all convert_* functions into libi3.
Some minor fixes along the way as well. Very minor stuff, unlikely
to ever be visible to the user.
2011-11-16 20:54:30 +00:00
Michael Stapelberg 726f2a1e5a normalize file headers across **/*.{h,c} 2011-10-25 21:19:38 +01:00
Michael Stapelberg f4469eee0b get rid of xcb.c in all i3-* tools
open_input_window was slightly different for each of them, so it made no sense
to generalize it (then we would end up with a thin and useless wrapper).
2011-10-23 23:20:57 +01:00
Michael Stapelberg a58018cf66 Add libi3/load_font, use it everywhere
…except for i3bar, which needs slightly more information about the font
2011-10-23 22:37:11 +01:00
Michael Stapelberg 05d097bb36 i3-input: fix handling of Mode_switch (makes special characters work again)
This seems to have only worked before in certain settings, where the modifiers
were configured in a way that it matched by chance…
2011-10-23 19:34:48 +01:00
Michael Stapelberg 7c04e23ab7 i3-input: Bugfix: font must be dynamically allocated, we FREE it later 2011-10-23 19:34:21 +01:00
Michael Stapelberg cb9bbcfccf Move get_colorpixel to libi3, use it everywhere else 2011-10-23 17:38:21 +01:00
Michael Stapelberg 0086bcb2b4 i3-input: eliminate xcb_change_gc_single usage with C99 2011-10-23 17:26:06 +01:00
Michael Stapelberg 4f57d49318 add libi3/ipc_connect, use it in i3-config-wizard, i3-input, i3bar 2011-10-23 17:18:14 +01:00
Michael Stapelberg 9d15a00ba8 introduce sasprintf() in libi3, use it everywhere 2011-10-23 13:16:56 +01:00
Michael Stapelberg d87b0f13a0 i3-input: use IPC functions from libi3 2011-10-23 13:15:20 +01:00
Michael Stapelberg 1737a78fcd i3-input: implement -F (format) option, deprecate -p (prefix)
This introduces the '-F format' parameter, which takes a format and replaces %s
in it with the user input. An example: The user should enter the target
workspace name. The appropriate i3-input invocation looks like this:

    i3-input -F 'workspace "%s"' -P 'Switch to workspace: '
2011-09-18 13:51:11 +01:00
Michael Stapelberg fddee471e8 i3-input: add missing \n in --help 2011-09-18 13:21:45 +01:00
Michael Stapelberg 46ab86b88d i3-input: reformat main.c 2011-09-18 13:20:59 +01:00
Michael Stapelberg 307a036d5c i3-msg, i3-input: get the I3_SOCKET_PATH atoms if socket path was not specified 2011-03-19 21:23:55 +01:00
Michael Stapelberg cd0b7282e0 i3-input: remove dependency on xcb-event 2011-03-18 17:32:37 +01:00
Michael Stapelberg 7b01bc5eb7 Bugfix: use the global root variable, don’t get the first one (Thanks quaec)
The case of an X11 server having multiple displays is handled correctly by the
code in src/mainx.c. However, due to some functions not being correctly
refactored and still getting the first screen (and also the first root window)
from the XCB connection, i3 was operating on the wrong root window.
2011-01-28 00:41:53 +01:00
Axel Wagner 4caf85aa0b Use I3SOCK-environment-variable 2011-01-12 10:15:48 +01:00
Michael Stapelberg cd2ee61ee8 fix some memory leaks when user passes command line arguments twice (Thanks Tiago) 2011-01-12 10:12:24 +01:00
Axel Wagner 3d274cf2f9 Add font-option to i3-input 2011-01-02 12:22:39 +01:00
Michael Stapelberg 85730d6892 Fix numlock state
Apparantly, after activating numlock once, the numlock modifier
stays turned on (use xev(1) to verify). So, to resolve useful
keysyms, we remove the numlock flag from the event state. What
currently does not work is actually using your keypad.
2010-03-24 03:28:38 +01:00
Michael Stapelberg 5dd5956241 i3-input: Bugfix: repeatedly grab the keyboard if it does not succeed
This should fix ticket #175
2010-03-03 10:08:17 +01:00
Michael Stapelberg 37fbea6a8a Bugfix: i3-input: Allocate one more character for null-termination 2009-10-23 20:06:18 +02:00
Michael Stapelberg acb07b95c0 i3-input: Bugfix: Don’t try to convert the prompt if there is no prompt 2009-10-07 21:28:15 +02:00
Michael Stapelberg 3ada8f326c Implement vim-like marks
Commands are 'mark' and 'goto'. Both can be used either directly,
like 'mark a' and 'goto a', or interactively (just 'mark'). For
interactive mode, i3-input must be installed and in your PATH.
2009-09-20 16:54:29 +02:00
Michael Stapelberg 6510b0e14f i3-input: implement prefixes for commands 2009-09-20 16:01:41 +02:00
Michael Stapelberg ca9b52bfcc Add initial version of i3-input, an interactive tool for sending IPC commands 2009-09-20 15:44:14 +02:00