Commit Graph

82 Commits

Author SHA1 Message Date
Arvydas Sidorenko ecc930dbe0 Replaced deprecated math.mod to math.fmod
Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-06-16 12:58:09 +02:00
Uli Schlachter 95d46f2e32 Fix a typo in commit fa1ca8070
In commit "awful.client.setslave: Fix for not-visible clients", I copied some
code from awful.client.visible(). However, I missed that I where supposed to
change something in the code that I had copied. Whoops.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-06 18:52:00 +02:00
Uli Schlachter fa1ca80705 awful.client.setslave: Fix for not-visible clients
Previously, setslave() put a client only at the end of the list of visible
clients. Obviously this means that it didn't do anything helpful if the target
client was not visible.

Fix this by iterating over all clients on the target screen instead of just the
visible ones.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-05-05 10:04:51 +02:00
Uli Schlachter 819daca18c Focus history: Don't ignore unfocusable clients
The only caller of focus.history.add() should be the "focus" signal, so at that
time the unfocusable client already does have the focus. At that point, there is
no reason why this shouldn't be recorded in the focus history.

(And yes, unfocusable clients can be focused. Don't ask.)

This should hopefully fix FS#778.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-06 12:19:12 +02:00
Anurag Priyam 0cf3da1adc introduce awful.client.run_or_raise
Jump to client if running, else launch it.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-02 14:37:47 +02:00
Anurag Priyam c623734632 rename the iterator methods named cycle to iterate, and prettify luadoc a bit
To avoid collision and confusion with other methods having the same name.  So,

    awful.client.cycle -> awful.client.iterate (renamed)
    awful.util.table.cycle -> awful.util.table.iterate (renamed)

These methods were added in commit "add awful.client.cycle", and "add
awful.util.table.cycle".

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-02 14:37:47 +02:00
Anurag Priyam cca672faa8 awful.client.jumpto: add missing luadoc for the parameter 'c'
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-04-01 21:46:48 +02:00
Anurag Priyam 55cbbac45b introducing awful.client.jumpto
I simply moved out the code to 'jumpto' a client from
`awful.client.urgent.jumpto` into a separate function of its own so that it can
be reused.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-03-07 13:30:30 +01:00
Anurag Priyam 0d41d98468 add awful.client.cycle
add awful.client.cycle to iterate through clients that match a given condition

A common use case is to cycle through clients that match a given rule and take
certain action on them: raise, set or get property, etc.; see usage example in
the docs.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-02-17 16:20:31 +01:00
Corey Thompson 8c62698bf6 Initialize floating_geometry on property::border_width signal (FS#826)
Initializing the client property "floating_geometry" on the
property::geometry signal is problematic since this is emitted before
client_set_border_width(), causing the internal client geometry to get
stored and later passed to client:geometry() which assumes it includes
titlebar and borders.

Signed-off-by: Corey Thompson <cmtptr@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-12-09 22:03:10 +01:00
Gregor Best c2ea920ca0 remove encoding=utf-8 from modelines
This option is no longer valid in modelines, so it has been removed from
all modelines using the following shellscript:

    #!/bin/ksh

    git ls-tree -r HEAD | cut -f2 | while read f; do
        egrep -e '^(//|--) vim: .*encoding=' $f >/dev/null || continue
        sed -E -e '/^(\/\/|--) vim:/s/:encoding=utf-8//' $f > /tmp/foo
        mv /tmp/foo $f
    done

Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-09-11 17:34:09 +02:00
Perry Hargrave 11487b84f0 movetoscreen:Dont refocus the selected client
Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-08 18:23:02 +02:00
Perry Hargrave c606bc36a8 awful.client.jumpto: View urgent clients smarter
Only do a tag.viewonly() if the urgent client is not visible.

Further, if the boolean 'merge' parameter is true [default false], then
to a tag.viewmore() with all the currently visible tags.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-05-13 15:14:38 +02:00
Andres Freund af6915fda2 Correct typo in awful.client.restore
This corrects a type in awful.client.restore which caused it not to restore any
client at all  if all clients are minimized.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-01 16:08:09 +01:00
Uli Schlachter 935e9a0e30 Add awful.client.restore()
This restores the first minimized client it finds on the selected tags.

Optionally, this function accepts a screen number as its first argument.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 22:23:35 +01:00
Uli Schlachter d8dc4bb2f5 awful.client.floating.toggle: Fix for dialogs
awful.client.floating.get() does some sensible defaults. E.g. dialogs are
floating by default. Since floating.toggle only checked the property, these
defaults made it break.

So floating.toggle() should use floating.get to decide if a given client is
floating. It should also use "false" instead of "nil" when the client is made
non-floating or else the default will apply again.

Thanks to vsp for making me figure this out. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 23:03:05 +01:00
Uli Schlachter 75956804bd Make awful.client.idx public
The luadoc API documentation already contained this function and it seems to be
useful for user configs.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-03 14:18:11 +01:00
Uli Schlachter b833ae75eb awful.client.setwfact: Handle invisible clients (FS#693)
setwfact() calls idx() on the client that it works on. When idx() is called with
a client that isn't visible, it fails while trying to find outs the client's
index in the current layout.

  event_handle_mousegrabber:119: error running function:
    lib/awful/client.lua:688: attempt to compare nil with number

Fix this by ignoring all clients that aren't visible in setwfact().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-12-11 14:20:42 +01:00
Uli Schlachter 932e0bfcd0 Add two more missing signals
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-27 21:42:14 +02:00
Uli Schlachter ab4c151ed8 Add signals before using them
This commit makes it an error if an unknown signal is connected, disconnected or
emitted. All signals have to be added before they can be used.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 23:00:36 +02:00
Julien Danjou 6d332f07a0 lua{class,object}: rename signals functions
I knew this was wrong at the beginning, f*ck.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-08-25 20:28:20 +02:00
Uli Schlachter 71ba321032 Check "focusable" in awful.client.focus.filter(c)
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-12 13:18:40 +02:00
Julien Danjou 9388dc5a1e awful.client: fix initial geometry storage (FS#608)
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-22 15:56:58 +02:00
Jacob Winther 808be1d9b8 variable set twice in client.lua
Very small fix.

From 6933b43bd3d00baba661b367db5450a9179da0c7 Mon Sep 17 00:00:00 2001
From: Jacob Winther <jacob.winther@gmail.com>
Date: Sat, 12 Sep 2009 06:59:58 +1200
Subject: [PATCH 1/2] awful.client: remove duplicate variable

Signed-off-by: Jacob Winther <jacob.winther@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-13 14:33:31 +02:00
Sébastien Gross 6511042f82 client: Fix get_client_in_direction
Both is_in_direction() and calculate_distance() expect clients
instead of geometries.

Signed-off-by: Sébastien Gross <seb•ɱɩɲʋʃ•awesome•ɑƬ•chezwam•ɖɵʈ•org>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-04 13:31:28 +02:00
Julien Danjou 905dddafe6 awful.client: fix direction functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-28 15:31:16 +02:00
Uli Schlachter 023a216f67 awful.client: Emit correct signal
When awful.client.property.set() was called it always emitted property::floating
on the client. Instead it should emit propert::<name of the property> of course!

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 10:54:05 +02:00
Gregor Best efbba53507 awful.client: fix local function idx
Signed-off-by: Gregor Best <gbe@intepi.net>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-27 10:53:31 +02:00
Julien Danjou 6bad89fc2c awful.client: movetotag() move client to the screen tag
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 16:09:56 +02:00
Julien Danjou b3214e589e Partial revert of "awful.client: use signal and geometry attributes"
Partial revert of 1da49640b5.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 21:15:19 +02:00
Julien Danjou 65825bdd22 awful: move hooks to signals
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 1da49640b5 awful.client: use signal and geometry attributes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou b58d0f848a client: emit signal on unmanage
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou 7954f19417 client: emit signal on manage
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-21 15:30:47 +02:00
Julien Danjou cb2cad6b09 client: emit class signal on focus
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-19 16:05:59 +02:00
Gregor Best fb68558b2f awful.client: call property hook on wfact change
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-07-15 09:42:08 +02:00
Julien Danjou 5922eb1fc1 awful.client: register property windowfact and floating for arrange
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:43:29 +02:00
Julien Danjou afbf72fc49 awful.client: call property hook on each prop change
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-10 11:43:20 +02:00
Julien Danjou 0c564079b5 wibox: add property hook on screen and visible changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-06-04 17:51:07 +02:00
Julien Danjou a891ffbe2d awful.tag: call property hook on icon changes
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-05-18 16:57:12 +02:00
Nikos Ntarmos a91e31dbe6 Fix toggletag
awful.client.toggletag assumes that the tags array is indexed by tag
objects. This appears to not be the case after v3.2-31-g6430738, when
client objects stopped using otables. This patch makes toggletag iterate
through the client tag array till it finds the entry to remove,
otherwise it appends the new entry at the end.

Signed-off-by: Nikos Ntarmos <ntarmos@cs.uoi.gr>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-23 23:38:31 +02:00
Julien Danjou e4ab810154 awful.client: do not use otable()
We use a weak-keyed-table, that's enought and quicker.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-04-12 15:11:33 +02:00
Maarten Maathuis b26a21ab0c client: fix luadoc typo
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 14:40:07 +01:00
Maarten Maathuis 0bab6e81b9 client: add dockable.{set/get}
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 14:40:07 +01:00
Aleksei Gusev 07b8751ad9 awful.client: removed focusing tag when the urgent window is sticky
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-28 09:26:20 +01:00
Julien Danjou eac5936393 lib: use Lua implementation of otable
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-14 17:19:58 +01:00
Gregor Best f0ca12837a awful.client: store floating geometry of clients in awful
Signed-off-by: Gregor Best <farhaven@googlemail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-14 08:36:40 +01:00
Julien Danjou 5154cfc19f remove deprecated functions
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:58 +01:00
Julien Danjou e6c7770b33 awful.client: remove debug print() (FS#469)
Shame on me.

Signed-off-by: Julien Danjou <julien@danjou.info>
2009-03-12 11:49:54 +01:00
dcurtis@cs.uiowa.edu 8f7ecb798d awful.client: Automatically select the current client during a toggle
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-02-24 11:08:22 +01:00