Commit Graph

5563 Commits

Author SHA1 Message Date
dodo 3a4761732c awful.menu: handling with strings
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 12:28:51 +02:00
dodo cd201bdf6a convert menu width and height from string to number
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 12:28:49 +02:00
dodo ea40a922ed awful.menu: rewrite
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 12:28:45 +02:00
dodo 2f3bc619cb wibox.layout.*: add get direction method
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 12:28:41 +02:00
dodo af756bb0d1 wibox.widget.background: set foreground
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-31 12:28:38 +02:00
Julien Danjou 52dfb76819 awful.rules: fix typo in example
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-03-29 09:37:30 +02:00
Anurag Priyam 448583e87c rules: allow defining exceptions to a rule - except, and except_any
So you want to make all Firefox windows floating except the main window
(instance = Navigator). You can either list all possible windows in
rules and make them floating, or make all of them floating except one:

{ rule = { class = "Firefox" },
  except = { instance = "Navigator" },
  properties = {floating = true},
}

More examples in the docs.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-29 09:26:24 +02:00
Gregor Best 33e88ea8d4 awful.mouse: fix interclient border snapping
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 12:27:09 +02:00
Uli Schlachter 13364a0181 Turn globalonf.drawins into the list of visible drawins
This fixes a crash when the opacity of a not-visible drawin is changed. This
happened because we got a PropertyNotify for our own change of _NET_WM_OPACITY
and then tried to set the drawin's opacity to this new value.

However, the drawin was only reachable through globalconf.drawins and wasn't
ref'd in lua.  This means that the luaA_object_push() call in
property_handle_net_wm_opacity() didn't find the drawin and instead pushed a
nil. This then later caused an unprotected lua error in window_set_opacity().

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-28 08:29:30 +02:00
Uli Schlachter af5e5e8e9c Remove a useless function argument
Both client_isvisible() and client_maybevisible() where almost exclusively
called with the client's screen as their second argument. Remove this second
argument and let these functions instead always act on the client's screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 20:07:14 +02:00
Uli Schlachter 244d19fd0e Stop doing per-screen banning
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 20:01:05 +02:00
Uli Schlachter 646eaad18e awful.menu: Fix for removal of screen property
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 16:36:20 +02:00
Uli Schlachter ca5337e731 naughty: Fix for removal of screen property
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 16:36:01 +02:00
Uli Schlachter 8453d0cc4f awful.wibox: Fix for removal of screen property
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 16:35:43 +02:00
Uli Schlachter f5a5af4001 awful.wibox: Fix for removal of screen property
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 16:35:15 +02:00
Uli Schlachter 08cd44dda7 drawin: Remove screen property
There isn't much point in the screen property of a drawin because the geometry
already defines on which screen the drawin is.

The biggest chunk of changes from this is due to removing the functions
drawin_detach and drawin_attach which where called when the screen property was
set/unset.

The code from drawin_detach is moved into drawin_set_visible and drawin_wipe.
drawin_attach is moved into drawin_init.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-27 16:21:49 +02:00
Chris Newton 471babcc70 Added a flag to the exit signal
This boolean can be used to differentiate between restarts and exits.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-21 07:41:41 +01:00
Gregor Best 07e63bd564 awful.mouse: fix client snapping
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-21 07:38:44 +01:00
Uli Schlachter e59f17357d tasklist/taglist: Handle invalid text better
When some client sets an invalid window title, a lua error was generated while
updating the tasklist. This caused all later tasklist entries to be skipped /
missing and the last entry to be empty.

Fix this by catching lua errors with pcall.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-18 17:28:38 +01:00
Uli Schlachter b6baca5857 Client: Only emit property::{x,y,width,height} if necessary
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-11 17:21:00 +01:00
Uli Schlachter eff4474c6d Move size-hints handling to lua
The C core now completely ignores size hints and let's lua handle them.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-11 17:21:00 +01:00
Uli Schlachter 4e31c72497 drawin: Remove some dead code
Thanks to a recent commit, a drawin's window will always be a valid and existing
window. This means we can remove all the code which checks this before doing
something.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-09 16:21:20 +01:00
Uli Schlachter 61fde273ca drawin: Update the drawing-stuff less often
We don't need an up-to-date pixmap and cairo surface for a drawin which isn't
visible. Thus, only bring those up-to-date when the drawin is visible.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-09 16:21:20 +01:00
Uli Schlachter 2f406a9385 Simplify drawin screen handling
Instead of creating/destroying a window whenever the drawin is attached/detached
from some screen, a window is now created when the drawin is created and it
isn't destroyed until the drawin is garbage collected.

Since we can now safely assume that a drawin always has a associated window,
this should make it possible to simplify some stuff.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-09 16:21:08 +01:00
dodo 5d9fa5614e display ontop mode for clients in awful.widget.tasklist
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-08 19:40:42 +01:00
Uli Schlachter 07164aa995 awful.menu: Handle invalid images better
This fixes problem where e.g. loading an image fails and thus the displayed
layout gets messed up.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-04 22:07:36 +01:00
Uli Schlachter 01e6e2a07b imagebox: Refuse invalid images
This makes the imagebox widget refuse images which have a zero or negative width
or height. A zero size causes problems where a division by zero results in inf
which makes various stuff fail in weird ways later on.

Additionally, cairo's "error surfaces" have a negative size. Displaying those
would cause all sorts of weird problems, too, so we better reject those.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-04 22:03:42 +01:00
Uli Schlachter 00273528b0 awful.placement.no_overlap: Honor original position
awful.placement.no_overlap caused clients on an otherwise empty desktop to stich
to the top-left corner of the screen because it always preferred the top-left
corner of the available space.

This commit doesn't change the way in which the available area is computed, but
instead this now tries to keep the client at its original position if that is
available.

This fixes cases where calling awful.placement.no_overlap as a callback from an
awful.rule rule didn't work because the manage signal in the default config
later overrode that via calling awful.placement.no_overlap.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-03-01 17:52:00 +01: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
dodo 9befc30a7b add pango alignment to wibox.widget.textbox
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-28 10:02:09 +01:00
Thomas Moschny 8b6adbffea Normalize icon path names (fixes #869).
The elements in ${icon_sources}, as returned by file(GLOB ...) contain
double slashes, could be a bug in cmake. This causes building with
cmake 2.8.4 to fail, due to dependency problems lateron.

This patch works around the issue by normalizing all path names in
${icon_sources} while appending them to ${ALL_ICONS}, thereby removing
the double slashes.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-21 18:07:59 +01:00
Uli Schlachter da9e4a52df Bind awful.client.restore to mod+ctrl+n
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 22:26:21 +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 9d0cf27593 tasklist: Update when a c.minimized changes
This fixes a bug where the tasklist would still show its old content after a
client was minimized/unminized because it didn't connect to the appropriate
signal.

This wasn't noticed before, because in most cases minimizing a client also
unfocuses this client which causes a tasklist update.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-19 21:42:39 +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 dafcc68427 Send correct signals when c.name updates
When a client sets WM_NAME (client->alt_name) but doesn't set _NET_WM_NAME
(client->name), we give alt_name to lua when c.name is used. However, we still
emitted property::alt_name instead of property::name to lua. Obviously, this
breaks stuff.

(The same applies to client->alt_icon_name)

I noticed this via feh whose tasklist entry wasn't refreshed when multiple
images were displayed and I switched to the next one.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-10 17:04:26 +01:00
André Aparício 3b0a20ca3b Fix default naughty preset for dbus notifications
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-02-03 18:08:04 +01:00
jpike 4972a280b0 Add naughty.config.notify_callback
This optional callback can be used for filtering and/or editing
notifications.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-28 21:05:09 +01:00
Uli Schlachter 88aff03005 Don't focus a different screen on unmanage (FS#850)
When some client on the left monitor was closed while client.focus is on the
right monitor (e.g. 'sleep 5 ; exit' in a terminal), awful.autofocus would shift
the input focus to whatever client happened to be next in the focus history on
the left monitor.

Fix this by only ever moving the input focus between screens when a tag is
selected, not when some client does its magic.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-27 18:10:39 +01:00
Anurag Priyam 514fd796f3 add usage example for awful.menu
Added a very simple example to show the usage, and applicability of
awful.menu by dynamically constructing a menu of clients that match a
particular rule.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:00 +01:00
Anurag Priyam 2a4503ef04 fix minor grammar, and typo in awful.menu.new's documentation
Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:00 +01:00
Anurag Priyam 63503ac107 add markup to awful.menu.new's documentation
Display the possible keys to the 'menu' params as a bullet list
(unreadable otherwise).

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-26 22:10:00 +01:00
Uli Schlachter 40958f9d21 Use ._NAME for identifying oocairo surfaces
image:type() was removed from oocairo, because the ._NAME property already
exists and there's no need for two functions doing the same job.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-21 19:54:27 +01:00
Uli Schlachter 4ee86fc5e4 Make ./awesome -a work
Some time ago I added a --no-argb option with the short-hand version -a.
However, the short version didn't actually work. Whoops!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-19 20:02:41 +01:00
Uli Schlachter 659d949052 Tag clients more intelligently (FS#700)
Before this commit, c:tags(tags) and t:clients(clients) first removed all
tags/clients and then added the new one.

This is now changed into only removing the tags/clients that have to be removed
and leaving the others in place. Hopefully, this avoids all kinds of weird
issues which we had.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-18 14:21:37 +01:00
Anurag Priyam 1d42fd9697 add usage example for keygrabber API
To demonstrate keygrabber API usage, I added a small function to the
docs that can be bound to a key and used to resize clients using
keyboard.

Signed-off-by: Anurag Priyam <anurag08priyam@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-16 20:20:44 +01:00
Uli Schlachter 78a1788c6f Fix a stupid typo, sorry
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-14 19:06:54 +01:00
Uli Schlachter ecb8376c44 naughty: Try ignoring all markup before giving up
naughty now tries to ignore all pango markup by using :set_text() instead of
:set_markup(). If this fails, too, we must have been fed invalid utf8 which we
cannot do anything about.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-14 16:16:04 +01:00
Uli Schlachter ec72ee1b43 Fix naughty
I removed textbox' check() function, but forgot to see if anything actually
calls it. Just removing the call fixes all problems here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-14 16:12:05 +01:00
Uli Schlachter 6494540b0c Unban clients when they are focused
In commit 3dbf89c I removed a client_unban() in the code path for focusing
clients. The idea was that client focusing is now done after rebanning, so that
it should already be visible by the time this code is executed.

However, minimized clients obviously don't get unbanned, So we have to call
client_unban() here to make sure the client is unminimized.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-01-09 10:44:19 +01:00