Commit graph

459 commits

Author SHA1 Message Date
Daniel Eklöf
925dfb736a module/xkb: implement indicator state
For now, we only expose caps-, num- and scroll-lock, as booleans.
2019-01-19 12:30:07 +01:00
Daniel Eklöf
7bb849bdf4 xcb: use strncpy() to extract atom name 2019-01-19 12:18:54 +01:00
Daniel Eklöf
04f7f3485f particle/string: don't cut in the middle of an utf-8 multibyte
When limiting a string (due to it exceeding it's max length), make
sure not to cut it in the middle of an utf-8 multibyte, as this
results in an invalid utf-8 string.
2019-01-17 20:44:51 +01:00
Daniel Eklöf
09270c4670 particle/string: handle conversion failures in cairo_scaled_font_text_to_glyphs()
In particular, use cairo_scaled_font_text_to_glyphs() to calculate the
extents, since the cairo_scaled_font_text_extents() will leave the
scaled font in an error state, which is impossible to recuperate from.
2019-01-17 20:18:46 +01:00
Daniel Eklöf
1bbdaf145f module/xwindow: add missing break to switch case 2019-01-17 20:17:04 +01:00
Daniel Eklöf
64c366c051 xcb: cleanup err message generated by xcb_error() 2019-01-16 19:02:32 +01:00
Daniel Eklöf
85d1971ac3 module/i3: read socket path from root window's I3_SOCKET_PATH property
This way, we don't have to execute another process just to get the
path.
2019-01-16 17:22:13 +01:00
Daniel Eklöf
dc7fde335e main: refactor 2019-01-16 17:22:08 +01:00
Daniel Eklöf
b195c19599 bar: remove struct bar_run_context; store abort_fd in bar struct 2019-01-16 16:38:04 +01:00
Daniel Eklöf
a4ce3372ce main: refactor 2019-01-16 16:34:59 +01:00
Daniel Eklöf
77f8e6fa28 xcb: xcb_error() no longer prefixes error message with "XCB: " 2019-01-16 16:27:25 +01:00
Daniel Eklöf
bf558eca1b module/xwindow: log X errors 2019-01-16 16:26:27 +01:00
Daniel Eklöf
c5309abbd0 module/xwindow: don't crash if there is no active window 2019-01-16 16:24:56 +01:00
Daniel Eklöf
41c53a7b2f font: ref-count font objects 2019-01-15 21:01:18 +01:00
Daniel Eklöf
7525ae99eb font: cache loaded fonts
Instantiating a new font is expensive, both in CPU and
memory. Mitigate by adding a cache. On a hit, instead of instantiating
a new font, clone the one from the cache.

Remember, cloning is basically just a ref counter bump.
2019-01-15 20:48:04 +01:00
Daniel Eklöf
fae2e5cb18 xcb: add xcb_error(), a generic describe-an-x-error function
By default, generates an error message with the major/minor opcodes,
the error code and sequence number.

If available, it will use xcb-errors to generate an even better
description.
2019-01-15 20:44:21 +01:00
Daniel Eklöf
7a8ba94a49 bar: xcb-errors is optional
With it available, we get better (more descriptive) X error
messages. But it's not fatal, and we don't require it.
2019-01-15 19:26:02 +01:00
Daniel Eklöf
b0e384b2f3 module/xwindow: don't crash if window doesn't have a correctly sized PID property 2019-01-15 19:18:01 +01:00
Daniel Eklöf
d264a6a067 module/xwindow: correct logging "module" (name) 2019-01-15 19:17:37 +01:00
Daniel Eklöf
b62e66ccb6 bar: log X(cb) errors 2019-01-15 19:17:22 +01:00
Daniel Eklöf
33d811ae78 bar: set correct window title 2019-01-15 19:17:02 +01:00
Daniel Eklöf
c868a4ac46 particle/list: disable debug 2019-01-15 19:15:57 +01:00
Daniel Eklöf
8f58e161bc particle/string: disable debug 2019-01-15 19:15:48 +01:00
Daniel Eklöf
c3930ef60a xcb: create atom if it doesn't exist
Fixes a bug where not all atoms have (yet) been created when starting
f00bar as part of the WM startup (for example, with an 'exec' in i3's
config).
2019-01-15 19:14:52 +01:00
Daniel Eklöf
ceb4770d7f Merge branch 'plugins-builtin' 2019-01-14 20:57:20 +01:00
Daniel Eklöf
0d591fe5a1 allow plugins to be compiled into the f00bar main binary 2019-01-14 20:57:03 +01:00
Daniel Eklöf
00679dbeeb decorations: cmake: compact CMakeLists.txt by using foreach() 2019-01-13 21:55:48 +01:00
Daniel Eklöf
c6b83ac7dc particles: cmake: compact CMakeLists.txt by using foreach() 2019-01-13 21:55:42 +01:00
Daniel Eklöf
c6ce536cff particle/string: explicitly link against cairo
Because it's the right thing to do. It worked without it, since the
f00bar main binary is linked with -rdynamic (to give plugins access to
core functions).
2019-01-13 21:49:24 +01:00
Daniel Eklöf
bc9c33c187 particle/dynlist: link particle-sdk PRIVATE:ly 2019-01-13 21:45:49 +01:00
Daniel Eklöf
2f83ed1fc3 particle/dynlist: compile as a shared library 2019-01-13 21:43:56 +01:00
Daniel Eklöf
1cce649f06 Reduce header intra-dependencies 2019-01-13 19:42:16 +01:00
Daniel Eklöf
5e107414e4 Merge branch 'decorations-as-plugins' 2019-01-13 17:51:15 +01:00
Daniel Eklöf
7cf6735363 plugin: typedef for configuration verification function pointer 2019-01-13 17:46:24 +01:00
Daniel Eklöf
1c18dbf1a0 decorations: remove header files 2019-01-13 17:45:09 +01:00
Daniel Eklöf
7754ef3661 decorations: are now plugins 2019-01-13 17:43:25 +01:00
Daniel Eklöf
4eee71eaf4 particles: cmake: header files have been removed 2019-01-13 17:41:48 +01:00
Daniel Eklöf
4a26664d8d particles: remove config-verify.h from particle.h 2019-01-13 17:41:39 +01:00
Daniel Eklöf
f952347c84 module/backlight: don't divide by zero 2019-01-13 17:40:17 +01:00
Daniel Eklöf
bc62843c91 modules: get rid of struct module_info
Since this struct only contained function pointers, make all modules
export those functions directly.

The plugin manager now defines a module interface struct, and fills it
it by dlsym:ing the functions that used to be in module_info.
2019-01-13 17:09:11 +01:00
Daniel Eklöf
07b1615a41 particles: get rid of struct particle_info
Since this struct only contained function pointers, make all particles
export those functions directly.

The plugin manager now defines a particle interface struct, and fills
it it by dlsym:ing the functions that used to be in particle_info.
2019-01-13 17:03:35 +01:00
Daniel Eklöf
d35695e98a particle: we no longer count the attributes
Since the attribute lists are now NULL-terminated.
2019-01-13 16:50:16 +01:00
Daniel Eklöf
74b0722d2f particles: remove header files 2019-01-13 16:49:46 +01:00
Daniel Eklöf
8d26ff7de2 module: module->begin_expose() have been removed 2019-01-13 16:45:35 +01:00
Daniel Eklöf
76d135e257 module: remove module_run_context
Store abort_fd directly in the module struct instead. This then allows
us to pass the module pointer as-is to the modules' run functions.
2019-01-13 15:34:59 +01:00
Daniel Eklöf
acdeff3b6e module: remove ready_fd
All modules are expected to handle a call to content() after having
been instantiated.

I.e. modules *cannot* even expect run() to have started running.
2019-01-13 15:25:39 +01:00
Daniel Eklöf
65cfcfb2de module/battery: initialize state in constructor 2019-01-13 15:08:09 +01:00
Daniel Eklöf
f04ff31d0f module/xkb: lock in content, and handle no layout available 2019-01-13 15:04:18 +01:00
Daniel Eklöf
825b0a16f8 module: remove module->begin_expose()
Replace with module_begin_expose()
2019-01-13 14:58:30 +01:00
Daniel Eklöf
4c577766d1 module: remove module->expose() and module->end_expose()
Bar now calls exposable->expose() and exposable->destroy() directly
2019-01-13 14:55:21 +01:00