Commit Graph

271 Commits

Author SHA1 Message Date
Uli Schlachter 4c517cf9d3 Screen __index: Don't turn argument into a string
Calling lua_tostring() on a number/integer, turns that stack slot into a string.
This patch changes the code to only call lua_tostring() if the function argument
really is a string.

This partly also caused https://github.com/awesomeWM/awesome/issues/238.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2015-08-29 18:05:57 +02:00
Uli Schlachter 53c19edae6 Make debug::index::miss and newindex work on classes and all objects
Signed-off-by: Uli Schlachter <psychon@znc.in>
2014-03-23 19:30:59 +01:00
Uli Schlachter 0bdaed2704 screen: Fix screen equality comparison (FS#1151)
We did some black magic which broke and was replaced with more black magic. This
now broke using screen objects as table indexes:

  $ echo 'local l, s = {}, screen[1] ; l[s] = 42 ; return l[s]' | awesome-client
  double 42
  $ echo 'local l, s = {}, screen[1] ; l[s] = 42 ; return l[screen[1]]' | awesome-client
  <no output>

Fix this by using just a single lua userdata for representing a screen object.

It would be even better if screens were allocated with lua, but that doesn't
really provide any benefits right now and would be more complicated...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-10-04 15:24:09 +02:00
Uli Schlachter fd8f2e23ee screen: Make sure we always have a screen
It is possible to configure RANDR so that no outputs are available. This means
awesome would be running with zero screens which leads to all kinds of
funnyness.

Work around this by falling back to other configuration mechanisms if we get no
screens from one of them. After all, screen_scan_x11() will always be able to
add a screen.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-09-27 23:07:33 +02:00
Uli Schlachter 23b30be106 Move size hints handling back into C (FS#1117)
Having this in lua means that size hints are only applied after the client got
resized. The bad side effect of this is some flickering if awesome is being
slow. And apparently, it is slow for way too many people...

Signed-off-by: Uli Schlachter <psychon@znc.in>
2013-03-10 12:13:32 +01:00
Uli Schlachter 0c6fd178ed screen: Ignore RANDR displays in clone mode (FS#1046)
This just makes the code for ignoring screens on Xinerama apply to RANDR screens
as well. The code now also applies to protocol screens, but there is only ever a
single one of those, so nothing should change here.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-11-21 22:08:12 +01:00
Uli Schlachter 8348d44444 Tags: Remove screen property
A tag's screen is now implemented purely in lua and it is no longer C's
business.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-10-23 10:05:34 +02:00
Arvydas Sidorenko d61cdb86c9 Renamed luaL_reg to luaL_Reg
The original struct name is luaL_Reg, but Lua v5.1 had a
`typedef luaL_reg luaL_Reg`, which in v5.2 was removed
and as a result breaking the build in Awesome which uses luaL_reg
version exclusively.

Signed-off-by: Arvydas Sidorenko <asido4@gmail.com>
2012-06-12 10:52:10 +02:00
Uli Schlachter eb38654cae Revert "screen: Add screen.by_coords()"
This reverts commit 826861d967.
2012-01-15 16:51:52 +01:00
Uli Schlachter 826861d967 screen: Add screen.by_coords()
This idea came from here:
http://article.gmane.org/gmane.comp.window-managers.awesome.devel/6759

Signed-off-by: Uli Schlachter <psychon@znc.in>
2012-01-15 16:05:11 +01:00
Majic 0e8fc995bb Minor readability fixes, STREQ()-like macros added
Signed-off-by: Julien Danjou <julien@danjou.info>
2011-11-18 17:56:21 +01:00
Uli Schlachter 0181a64468 Screen: Convert from lightuserdata to userdata
Setting a metatable on a lightuserdata sets the metatable for *all*
lightuserdata. Only tables and userdata have per-instance metatables.

This commit is an ugly hack to convert screen objects to real userdata.

Mailing list thread:
http://thread.gmane.org/gmane.comp.window-managers.awesome.devel/6543

Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-10-12 13:05:57 +02: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 4be3ae0120 Retain focus on clients moved across screens (fs#620)
Signed-off-by: Perry Hargrave <resixian@gmail.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
2011-07-08 18:22:57 +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 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
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 5f5787d97b Wibox: Rename to drawin
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:36:02 +02:00
Uli Schlachter d213f19c5f Widgets: Remove
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-10-06 13:27:21 +02:00
Uli Schlachter cbf9bbd66a screen_default_visual(): Move to awesome.c
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-30 14:43:58 +02:00
Uli Schlachter 87d869fdeb Delete the randr version reply
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-18 16:01:44 +02:00
Uli Schlachter 53ac35930d screen: Stop using a_tokenize()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-09-02 18:53:44 +02:00
Uli Schlachter e0774377ca Sort all signal lists alphabetically
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-26 17:46:17 +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
Uli Schlachter 948f960b7e Also rename the signal_* C function
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-25 20:48:42 +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 28de7741cd Remove globalconf.screen_focus
This moves the appropriate fields for client focus from screen_t to globalconf
since only the first screen's fields were used anyway.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-17 15:52:49 +02:00
Uli Schlachter 3b2f6329a9 Remove an unneeded argument to screen_getbycoord()
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:25:12 +02:00
Uli Schlachter 6b2e4352bb Remove globalconf.xinerama_is_active
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:20:45 +02:00
Uli Schlachter 5d35771673 Save the screen in globalconf.
There can only be on xcb_screen_t now, so we can save it in globalconf.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 14:10:58 +02:00
Uli Schlachter cc4e8d57d5 Move the default visual to globalconf
Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 13:59:51 +02:00
Uli Schlachter 32d9a5b2ab Remove support for zaphod mode
This makes awesome support only a single X11 protocol screen. If you are still
using zaphod mode, you can run multiple instances of awesome on the single
screens, e.g.:

DISPLAY=:1.0 awesome & DISPLAY=:1.1 awesome &

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-08-16 13:47:40 +02:00
Uli Schlachter e830df6092 Screen: Only use Xrandr if it provides data
This commit makes awesome ignore the screen geometry provided by Xrandr if it
only defines a single screen. This should work around nvidia's binary driver
which only provides useful data via Xinerama.

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-21 14:46:49 +02:00
Uli Schlachter 7bf1370502 Split up screen_scan()
This splits up screen_scan() into screen_scan_randr(), screen_scan_xinerama()
and screen_scan_x11(). These function try to set up screens via RANDR, Xinerama
and the classic core protcol setup.

No code in these functions was actually changed, only some indentation was
changed (and a "return true/false" added to the first two functions).

Signed-off-by: Uli Schlachter <psychon@znc.in>
2010-07-21 14:42:45 +02:00
Julien Danjou 38edc58097 client: implements maximized and fullscreen requests with Lua
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:29:29 +02:00
Julien Danjou fccc451f89 luaclass: add inheritance support
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:27:04 +02:00
Julien Danjou 9393b2d111 screen: add index by output name (FS#361)
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:26:23 +02:00
Julien Danjou c08b90345f screen: export RandR information
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:26:20 +02:00
Julien Danjou 8c87b7cb57 screen: store RandR information
Signed-off-by: Julien Danjou <julien@danjou.info>
2010-05-28 13:26:17 +02:00
Julien Danjou 371ee3e8cc titlebar: remove
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou e9ef51a521 wibox: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou 6fa62a3029 widgets: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou e204473dfc client: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:05 +02:00
Julien Danjou 104e28778b tag: move into objects
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou 4c178d5441 hooks: remove
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-10-20 20:42:04 +02:00
Julien Danjou 69fa11af8f screen: only untag if client had a screen
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-22 15:51:55 +02:00
Julien Danjou 890e15fa19 screen: fix tag removal/add
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-21 12:12:59 +02:00
Julien Danjou 8533c1d35d screen: makes luaA_pushscreen static
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-09-07 17:13:54 +02:00
Brian Gianforcaro 3145e3145e Grammar/spelling corrections in comments and docs.
Signed-off-by: Brian Gianforcaro <b.gianfo@gmail.com>
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-31 10:39:36 +02:00
Julien Danjou e293a69982 screen: move the tagging on screen change to Lua
Signed-off-by: Julien Danjou <julien@danjou.info>
2009-08-24 16:32:19 +02:00