Commit Graph

5074 Commits

Author SHA1 Message Date
Gregor Best 4d9211c8c3 fix some deprecated atom constants
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 21:44:43 +02:00
Uli Schlachter a2c6dde410 Remove all uses of attribute "unused"
Awesome is built with -Wno-unused-parameter which means there is no point in
explicitly marking arguments as unused.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 18:20:08 +02:00
Uli Schlachter 7b06933f5b Brown paper bag commit
I removed the function, but forgot to remove the prototype. Whoops!

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 18:20:07 +02:00
Uli Schlachter 5e761f8c24 Remove some more unused function arguments
We no longer use libxcb-event, so we don't have to follow it's API any more.
This means the pointless arguments and return values can be removed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 17:59:20 +02:00
Uli Schlachter 43bba587fb Stop using most of libxcb-event
Upstream removed most of the code from libxcb-event and there is no
event-related stuff left in this library. We now no longer use any of the parts
that were removed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 17:57:48 +02:00
Uli Schlachter d79578c918 Remove some unused function arguments
We no longer have to follow libxcb-property's API for these function, so we can
remove arguments which we don't use anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 16:57:25 +02:00
Uli Schlachter 721f33d5cc Stop using libxcb-property
libxcb-property will be dropped from xcb-utils in the next release, because
upstream thinks it's not really useful and well-designed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-08 16:57:08 +02:00
Uli Schlachter 54ff33fb04 Avoid some round-trips on startup
This makes awesome prefetch some of the data it needs during startup to avoid
some useless round-trips to the server.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-07 13:28:44 +02:00
Uli Schlachter 8d59512ccc Naughty: Handle invalid UTF-8 more sanely
Previously, if setting the textbox's text failed this caused more problems later
on. This commit makes sure that an invalid text never breaks pango.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-06 19:52:46 +02:00
Konstantin Stepanov 457913a0e8 stack graph mode works with max_value
Signed-off-by: Konstantin Stepanov <kstep@p-nut.info>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-05 14:27:41 +02:00
Uli Schlachter a77209c7fe Fix an unbalanced lua stack operation
ewmh_process_state_atom() does a luaA_object_push() at its beginning, but it
doesn't pop that object again. Fix this by, well, popping the object at the end
of the function again.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-03 11:27:11 +02:00
Ignas Anikevicius (gns_ank) 402870687b Functionality for deleting a tag using awful.tag.
tag.delete(t, fb):
    Delete tags if certain criteria are met:
        - There are no clients assigned exclusively to this tag.
        - Stickied clients have somewhere to go, 'fb' the fallback tag

    If after deleting there is no tag selected then try and
    history.restore() or select the first tag on the screen.

    Return true if successful and nil otherwise.

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Ignas Anikevicius <anikevicius@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-02 22:06:17 +02:00
Uli Schlachter cc33cd17a0 Remove systray icons from the save set
This commits makes awesome remove systray windows from the save set when they
are unmapped. This happens for the same reason as with normal client windows.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-25 09:28:09 +02:00
Uli Schlachter db958cafb4 Remove windows from the save set in unmanage
While a window is in the save set, it will automatically be made visible again
when awesome exits/dies. This makes sure that the next window manager will pick
this window up and handle it properly again.

But when a window explicitly asks not to be visible, it doesn't want to be
visible. Even if awesome dies. So we should remove the client's window from the
save set in client_unmanage.

Thanks to anrxc and his xwrits.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-24 19:46:23 +02:00
Uli Schlachter d45d31ebae awful.placement: Honor border width
While calculating if part of the window is outside the visible region, this code
should also add the border width. (FS#684)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-24 15:31:00 +02:00
Uli Schlachter 84676561da Make fullscreen stacking respect EWMH
Fullscreen windows should only get their own layer when they have the input
focus. When they are unfocused they should be treated normally (FS#560).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-23 12:27:49 +02:00
Uli Schlachter 9977802d7e Improve aspect size handling
The window is now no longer enlarged to make it fit into its aspect ratio, but
only ever made lower. This was verified with a small test app that sets a min
aspect ratio of 0.5 and max aspect ratio of 2.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 10:34:41 +02:00
Uli Schlachter 227b71921d Fix some size hint mixups
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 10:34:40 +02:00
Uli Schlachter f372388de9 Fix a minor ICCCM incompatibility
ICCCM says that the min size should be used for the base size if no base size is
specified. The only exception is when calculating the aspect ratio of the
window, in that case only the "real" base size may be used.

Awesome didn't do this last part before.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 10:34:39 +02:00
Uli Schlachter 418f3d0b37 Minor cleanup
Or'ing into a bool feels dirty and the struct members should all be documented.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 09:28:16 +02:00
Daniel Graña cc31fc32e6 Register systray only if systray widgets are attached. (FS#503)
Signed-off-by: Daniel Graña <dangra@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-22 09:28:01 +02:00
Uli Schlachter 6de41161f1 Ignore size hints on fullscreen windows
If a window is fullscreen it is supposed to cover the full screen. Obeying size
hints makes no sense in this case.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-21 17:51:47 +02:00
Uli Schlachter b90aa39dc9 Fix a brown paper bag bug in d7d70714d7
I cherry-picked this commit from master and there was a conflict. I fixed this
up by hand and apparently failed here.

Instead of first saving the systray window and then destroying the wibox, this
first destroyed the wibox and then tried to save the systray, but it was already
destroyed in the previous step. Just swapping these two calls fixes this.

Thanks to anrxc for making me notice how much I fail.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-18 16:20:24 +02:00
Uli Schlachter 312094ace3 Avoid some flickering when a new window opens
A new window is by default above all other windows. This means that when we map
it and then *later* move it to the correct place in the stacking order (thanks
to lazy restacking), the window on the top of the stack has to redraw itself.

I noticed this via naughty notifies redrawing themselves after opening a browser
window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-18 14:35:15 +02:00
Uli Schlachter d7d70714d7 Kick out the systray when wiping a wibox
When a wibox is destroyed or detached from a screen, it is wiped to clean up its
resources. This also includes destroying the window which is associated with the
wibox.

The problem here is that if the wibox contains the systray, the systray window
would automatically be destroyed since all childs of a window are destroyed when
said window is destroyed. To fix this, we kick out the systray window before
destroying the wibox' window.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-18 10:13:57 +02:00
Uli Schlachter 94a0349c62 Clear a draw_text_context_t during wipe()
This fixes a bug where pango was called with already-freed arguments because
wipe() didn't zero out those variables and a later init() failed.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-16 19:54:01 +02:00
Uli Schlachter 5487906487 Naughty: Catch invalid markup in notifications
Previously, an invalid markup caused an empty popup. Since the C core now throws
a lua error on invalid markup, we have a way to notice that something is wrong.

This patch first tries to set the notification's text the same way we did
previously. If that fails, everything is escaped and the result is used as the
text for the notification.

Thanks to farhaven/Gregor Best for the initial version of this and for the
string.gsub() call I stole from him. :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-16 19:40:08 +02:00
Uli Schlachter 62a0189f05 textbox: Throw a lua error on invalid markup
Idea by JD, inspired from a patch by farhaven.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-16 19:40:04 +02:00
Uli Schlachter 0655f13615 Read a textbox' text correctly
Previously, querying a textbox' .text property would return the text with all
pango markup stripped.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-16 19:39:48 +02:00
Uli Schlachter 64855b41cd Handle errors in the config better
luaA_loadrc() now returns a failure when executing the config file causes an
error.
Previously it returned a success which meant the next config file wasn't tried.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-15 19:22:28 +02:00
Uli Schlachter a6f2c73c67 Don't manually unban all windows on exit
The last commit made sure the X server does this for us instead. No need to do
that work twice.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 21:40:27 +02:00
Uli Schlachter 985bafaf84 Add all managed client windows to the safe set
When an application loses its connection to the X11 server, all the windows in
its save-set are saved by reparenting them back to their closest ancestor. Also,
to they are unconditionally mapped. This second property is exactly what we
need: All windows should be in mapped state, else the next window manager which
starts up won't be managing them.

This should fix all bugs where clients where lost due to a restart, yay! :)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 21:39:26 +02:00
Uli Schlachter 4a7f0abf4f Don't reparent systray windows on exit
Since the last commit, systray windows will automatically be reparented by the
X11 server. This means we no longer have to do this ourselves.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 21:39:21 +02:00
Uli Schlachter 775ea16efa Add systray windows to the save-set
When an X11 client disconnects from the X server, all of its windows are
destroyed. This also means that all the sub-windows of those windows are
destroyed which is not necessary what one wants to happen.

To work around this, X11 has a "save-set". All the windows that are in the
save-set are reparented to their closest ancestor when they would normally be
destroyed. This is just what this code needs. :)

(The windows in the save-set are also mapped when they are saved, dunno if this
hurts here or not)

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-14 21:39:18 +02:00
Julien Danjou 84150be3df change codename
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-07-14 08:30:09 +02:00
Uli Schlachter be9eb33230 Update the tasklist when a client's icon changes
Thanks to a pidgin-using friend for reporting this.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:05:53 +02:00
Uli Schlachter 95a5d3f80e Remove invalid variable usage
There is no variable called "startup" in awful.rules.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:33 +02:00
Uli Schlachter b296778185 Handle _NET_WM_DESKTOP more intelligently
This makes sure that an invalid value for this property doesn't cause the client
to have no tag at all. This should be especially useful when one uses dynamic
tags and restarts awesome which causes less tags to exist than before.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:33 +02:00
Uli Schlachter 6d0111264d Remove _NET_WM_DESKTOP when client got no tags
EWMH says that "Window Managers MUST keep this property updated on all windows",
but doesn't say anything about clients which got no desktop at all. Removing the
property seems to be the best we could do.

Signed-off-by: Uli Schlachter <psychon@znc.in>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-14 20:04:33 +02:00
Julien Danjou 03f949e54f Fix mouse::leave signal emit on widgets (FS#774)
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-09 16:08:48 +02:00
Gregor Best d45b36e79b dbus: fix compiling error
Signed-off-by: Gregor Best <gbe@ring0.de>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-06 14:32:47 +02:00
Julien Danjou ab08b302be dbus: only warn, dot not raises an error (FS#713)
This is not user-called error, so it's a really bad idea to raise an Lua
error here.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-06 10:46:33 +02:00
Julien Danjou dd84d88e0f naughty: return nothing, not nil
This is not a valid return value for a D-Bus method.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-06 10:38:34 +02:00
Julien Danjou 9445701655 Fix missing tostring
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-01 11:42:52 +02:00
Perry Hargrave 4f754a0d41 tag.lua: check name argument to add() is valid
Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-06-01 10:31:18 +02:00
Perry Hargrave 5b86896c90 tag.lua: add() create tags with full table of properties
tag.add(name, props):
    make tags and pass a table of properties to apply to it

tag.new:
    modified to use add() instead of calling capi.tag

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 11:21:02 +02:00
Perry Hargrave 14fd8fadb5 tag.lua: getidx() returns index of tag
tag.getidx(t):
    Return the index of 't' in the screen[]:tags() table. Return 'nil'
    if 't' is not found.

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 11:08:44 +02:00
Perry Hargrave 6362a90825 tag.lua: move() re-index tags
tag.move(i, t):
    move tag 't', or tag.selected(), to index 'i' in the current
    screen's tags table.

Signed-off-by: Perry Hargrave <perry.hargrave@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-29 11:05:11 +02:00
Julien Danjou cfebec085c Store widgets references as wibox items
This will store the widgets references that the wibox have inside their
environment table, and not in the global registry, avoiding memory leaks.
This should fix FS#771.

Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-25 15:43:18 +02:00
Renato Botelho 1f57213322 Do not install txt manpages files
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-20 19:57:54 +02:00