Commit Graph

6685 Commits

Author SHA1 Message Date
Daniel Hahler 0bcc4aa505 Merge pull request #324 from blueyed/improve-transient_for
Improve transient for handling.

Closes https://github.com/awesomeWM/awesome/pull/324.
2015-08-12 16:37:13 +02:00
Daniel Hahler 57ec268b8e tasklist: handle transient_for with skip_taskbar clients
Ref: https://github.com/awesomeWM/awesome/issues/182
2015-08-12 14:31:16 +02:00
Daniel Hahler 1aa1c8052d Add client.get_transient_for_matching and .is_transient_for 2015-08-12 14:31:16 +02:00
Daniel Hahler 11473aa490 Use awful.util.round in beautiful.xresources.apply_dpi 2015-08-12 14:18:57 +02:00
Daniel Hahler fe235b7fb7 awful.wibox: round x/y/width/height wibox arguments
Ref: https://github.com/awesomeWM/awesome/pull/320#issuecomment-130212116
2015-08-12 14:14:14 +02:00
Daniel Hahler f5ed8848e7 Use awful.util.round in wibox.layout.flex 2015-08-12 14:10:10 +02:00
Daniel Hahler 977bd9a60e Add awful.util.round 2015-08-12 14:09:45 +02:00
Daniel Hahler 178f479d15 drawin.c: check for integer for x, y, width, height
This adds luaA_getopt_integer, luaA_optinteger and luaA_checkinteger.

Lua 5.2 does not have support for this, but it would be available in Lua
5.3.

Closes https://github.com/awesomeWM/awesome/pull/320.
2015-08-12 14:07:22 +02:00
Daniel Hahler 9cbab8fa08 Merge pull request #388 from blueyed/placement-next-to-mouse
Add placement.next_to_mouse, use it for tooltips.

Closes https://github.com/awesomeWM/awesome/pull/388.
2015-08-12 13:23:31 +02:00
Daniel Hahler 251673f8b2 tooltip: use new next_to_mouse placement
This should take care of not placing the tooltip outside of the screen
already, so the call to `awful.placement.no_offscreen` can be skipped.
2015-08-12 13:22:59 +02:00
Daniel Hahler 9803af1b1f Add awful.placement.next_to_mouse 2015-08-12 13:22:59 +02:00
Daniel Hahler b959200bd0 Merge pull request #401 from psychon/simpler-timers
Simpler timers

Closes https://github.com/awesomeWM/awesome/pull/401.
2015-08-12 13:21:42 +02:00
Daniel Hahler d1bb53de18 Merge pull request #393 from psychon/ci-script-improvements
Ci script improvements

Closes https://github.com/awesomeWM/awesome/pull/393.
2015-08-12 13:18:51 +02:00
Uli Schlachter 1ebc34b5e9 Widgets: Also add a context argument to :fit()
Together with the context argument to :draw(), this even allows widgets to have
DPI-dependant size.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:19:48 +02:00
Uli Schlachter 88b98789a0 Rename the first argument to :draw to "context"
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:19:28 +02:00
Uli Schlachter 31b69dbe1a drawable: Use a context table as first argument to :draw()
This table contains the drawable, wibox and titlebar that we are drawing on, but
also includes the screen and the DPI of that screen. This allows widgets to
depend on the DPI in their rendering.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
Uli Schlachter e5a9eef157 Widget drawing: Add a traceback on errors
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
Uli Schlachter d122b825ee gears.timer: Fix the traceback on errors
With the second argument being 2, the traceback will not include the error
handling function, but instead end at the actual place of the error.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 11:17:48 +02:00
Uli Schlachter 3685077291 rect_to_device_geometry: Use gears.matrix.transform_rectangle
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 10:38:22 +02:00
Uli Schlachter 19b9bfc46e Move wibox.layout.rect_to_device_geometry to wibox.widget
Having two modules named "base" is confusing and "wibox.layout" doesn't contain
much useful stuff. This is a first step for removing wibox.layout by moving a
function which should only ever be used internally in awesome.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 10:38:22 +02:00
Uli Schlachter 16a1ef0f48 Add gears.matrix for working with cairo matrices
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 10:38:22 +02:00
Uli Schlachter 74276b3a11 gears.timer: Add a note about GC'ing timers
Ref: https://github.com/awesomeWM/awesome/issues/216

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:54:58 +02:00
Uli Schlachter 0367af2be9 gears.timer: Add simpler ways to start timers
This adds gears.timer.start(timeout, callback) that creates a timer object and
connects a callback to it, all in one go.

Additionally, this adds gears.timer.weak_start(timeout, callback). The weak
version still allows the callback function to be garbage collected and will then
stop the timer.

This was tested with the following code:

  require("gears.timer").start(0.3, function()
    print("ping")
    if collectgarbage("step", 500) then
      print("collection done")
      error("err")
    end
    return true end)
  require("gears.timer").weak_start(0.1, function()
    io.stdout:write(".")
    return true
  end)

After a full collection cycle, both timers are stopped. The first one is stopped
because of the error() that it generated. The second one is stopped because the
callback function was garbage collected.

Ref: https://github.com/awesomeWM/awesome/issues/216

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:54:55 +02:00
Uli Schlachter cbba615748 tests/run.sh: Show full error messages
If an error occurs during startup, tail might not show the full error message.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:30 +02:00
Uli Schlachter 0ee24317c7 tests/run.sh: Temporarily disable -x in wait_until_success
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:30 +02:00
Uli Schlachter 17e8827212 tests/run.sh: Factor out a helper function
This factors out a function wait_until_success that runs some command until it
succeeds (with a timeout) and uses this function in the two places where this
was already done before.

Note that this removes the "kill -0" trick for early exit again and instead will
use the timeout in case awesome dies during startup.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:28 +02:00
Uli Schlachter 0688e8899e tests/run.sh: Allow execution without installing
When this script is not run under Travis, it will prepare a temporary config
file and a theme file that point to the files that were not yet installed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:49:08 +02:00
Uli Schlachter d8a1b563e7 tests/run.sh: Use a temporary directory
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:48:28 +02:00
Uli Schlachter 41d81a4501 tests/run.sh: Move definition of AWESOME_CLIENT up
Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:48:27 +02:00
Uli Schlachter 6d4837a53a tests/run.sh: Start dbus after X server startup
The code does some dances with xrdb to ensure that the server finished starting
up. However, before this it already tries to access the server via dbus-launch.

Since nothing uses dbus in this part of the code, we can just move this down.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-12 09:48:27 +02:00
Uli Schlachter a166f86864 Merge branch 'keyboardlayout_no_layout_entry' of https://github.com/psychon/awesome 2015-08-12 09:40:12 +02:00
Uli Schlachter fe027345de Merge branch 'do-not-require-xdotool' of https://github.com/blueyed/awesome 2015-08-12 09:39:32 +02:00
actionless b47eabf4f0 feat(lib: awful: layout: suit: tile): add 'resize_jump_to_corner' 2015-08-12 00:12:15 +02:00
Daniel Hahler e47773933c Bump required lgi version to 0.7.1
Ref: https://github.com/pavouk/lgi/issues/41
Ref: https://github.com/awesomeWM/awesome/pull/392
2015-08-11 19:08:35 +02:00
Daniel Hahler 85facc0391 tests/run: handle 'expr 1 - 1' (exitcode 1); check for running awesome 2015-08-11 19:08:35 +02:00
Daniel Hahler 71f549ee79 Travis: add lgi 0.7.0 to the build matrix
This makes sure that the build and tests succeed with the minimal required
version.
2015-08-11 19:08:35 +02:00
Uli Schlachter 008cae50b2 awful.widget.keyboardlayout: Rename private members
I'm working on something that adds :layout functions to widgets. This clashes
with the keyboardlayout widget's use of an entry with this name. This change
adds an underscore as a prefix to the private data members of the
keyboardlayout.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-11 12:44:48 +02:00
Daniel Hahler 68b0fa243f Add "visible" property for widgets
Widgets with `visible = false` will not be drawn.

Closes https://github.com/awesomeWM/awesome/pull/326.
2015-08-10 23:09:07 +02:00
Daniel Hahler 5ad3f03283 keygrabber: ignore modifiers for name of control keys
`xkb_state_key_get_one_sym` returns `Meta_L` for a (release) event of
`Alt_L` when Shift is pressed.

This patch changes it to use `xcb_key_symbols_get_keysym` in the same
way like normal key handling does it in `event_handle_key`.  This was
changed in 372d12e, but apparently forgotten for the keygrabber.

Closes https://github.com/awesomeWM/awesome/pull/364.
2015-08-10 23:05:16 +02:00
Daniel Hahler 2b224dd954 tests: use root.fake_input instead of xdotool
Ref: https://github.com/awesomeWM/awesome/issues/328.
Closes: https://github.com/awesomeWM/awesome/pull/391.
2015-08-10 23:04:19 +02:00
actionless d5818d0e1a feat(lib: awful: layout: suit: floating): add 'resize_jump_to_corner' 2015-08-07 18:50:08 +02:00
Daniel Hahler ccaa8154be tests: use root.fake_input instead of xdotool
Ref: https://github.com/awesomeWM/awesome/issues/328
2015-08-04 21:30:38 +02:00
Daniel Hahler baeb8fd2b5 client_resize_do: remove honor_hints argument
This was only used by client_resize before, which now handles this
itself.

Ref: https://github.com/awesomeWM/awesome/pull/383#commitcomment-12483405.
2015-08-04 20:50:49 +02:00
Daniel Hahler 56d9e3b9de client_resize: apply size hints before calling client_resize_do
This will skip calling `client_resize_do` in case of honored size hints.

This could be also done in `client_resize_do`, but it appears to be
meant to force the resize.

Closes https://github.com/awesomeWM/awesome/pull/383.
2015-08-04 20:50:41 +02:00
Daniel Hahler b028a0ba1d xresources.apply_dpi: use "round" instead of "ceil"
Given an outcome of e.g. 1.01 its more sane to use 1 than 2, especially
for `border_width`.

This uses the method from `wibox.layout.flex`.

Closes https://github.com/awesomeWM/awesome/pull/389.
2015-08-04 20:48:17 +02:00
Daniel Hahler 88ba798ae3 Travis: apidoc: script, compare view, PR comment
This moves the apidoc uploading to build-utils/travis-apidoc.sh, which
makes it more pleasant to maintain/read.

Additional enhancements:
 - handle all branches and PRs, and provide compare view links as a comment
   for the latter, via awesome-robot.  This gets skipped for PRs for
   forks, because then the Github secret is not available for security
   reasons.
 - use a merge commit to keep relevant changes and boilerplate together.
 - simplified/shorter AWESOME_VERSION override.
 - add last commit message of the repo to the apidoc's commit message.

Closes https://github.com/awesomeWM/awesome/pull/358.
2015-08-02 21:55:16 +02:00
Daniel Hahler ecddee44cb Apply left/top titlebars in event_handle_configurerequest
I have noticed that the HeidiSQL session manager window/dialog will be
moved down by the height of the top titlebar when selecting an entry
from the server list.

Closes https://github.com/awesomeWM/awesome/pull/385.
2015-08-02 18:00:52 +02:00
Daniel Hahler aa93a8eac9 Merge branch 'tooltips'
Minor fixes / improvements to tooltips.

Closes https://github.com/awesomeWM/awesome/pull/373.
2015-08-02 15:38:38 +02:00
Daniel Hahler 9883d3484d titlebar: add tooltips for icon buttons
This uses the button name in the tooltip's text.
2015-08-02 15:36:54 +02:00
Daniel Hahler 14e63fbcd7 awful.tooltip: do not hide when entering its wibox
Because of `placement.under_mouse` (and without
`placement.no_offscreen` fixing it), this will cause the tooltip to hide
immediately again.

There is no need for hooking into this signal, but this adds a click
handler to close the tooltip when clicking into it.
2015-08-02 15:36:54 +02:00