Update to awesome-3.5.6, codename "For Those About To Rock"

This commit is contained in:
dcoppa 2015-01-12 09:00:17 +00:00
parent 53f6dd9279
commit afca0686d1
21 changed files with 39 additions and 1142 deletions

View File

@ -1,9 +1,8 @@
# $OpenBSD: Makefile,v 1.88 2014/12/16 11:16:05 dcoppa Exp $
# $OpenBSD: Makefile,v 1.89 2015/01/12 09:00:17 dcoppa Exp $
COMMENT= highly configurable framework window manager
DISTNAME= awesome-3.5.5
REVISION= 10
DISTNAME= awesome-3.5.6
EXTRACT_SUFX= .tar.xz
CATEGORIES= x11
@ -70,11 +69,7 @@ pre-configure:
post-install:
@rm ${WRKINST}${LOCALBASE}/share/awesome/lib/*.{beforesubst,orig} \
${WRKINST}${LOCALBASE}/share/awesome/lib/awful/*.{beforesubst,orig} \
${WRKINST}${LOCALBASE}/share/awesome/lib/awful/layout/suit/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/awful/widget/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/menubar/*.{beforesubst,orig} \
${WRKINST}${LOCALBASE}/share/awesome/lib/wibox/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/wibox/layout/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/lib/wibox/widget/*.orig \
${WRKINST}${LOCALBASE}/share/awesome/themes/default/*.{beforesubst,orig}
${INSTALL_DATA_DIR} ${PREFIX}/share/examples/awesome

View File

@ -1,2 +1,2 @@
SHA256 (awesome-3.5.5.tar.xz) = vzDb18RiF0KyVlkZQE8AlYjqSCV03bhaqlMBvOUljUc=
SIZE (awesome-3.5.5.tar.xz) = 719080
SHA256 (awesome-3.5.6.tar.xz) = N/Sd4YeCVCXLMJb8hwlZ1f7JMCsi/9Dyh02KGOhQRtc=
SIZE (awesome-3.5.6.tar.xz) = 720112

View File

@ -0,0 +1,30 @@
$OpenBSD: patch-awesome_c,v 1.12 2015/01/12 09:00:17 dcoppa Exp $
commit 635223b5fe599d94de4ab44d27500041f121e081
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Jan 11 10:42:45 2015 +0100
Remove titlebars from clients during shutdown
This reparents all clients back to their proper position during shutdown, so
that their top-left corner is now where their titlebar's top-left corner was.
Hopefully, this fixes floating clients moving around across a restart.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- awesome.c.orig Mon Jan 12 02:45:28 2015
+++ awesome.c Mon Jan 12 02:45:35 2015
@@ -72,6 +72,13 @@ awesome_atexit(bool restart)
lua_pushboolean(globalconf.L, restart);
signal_object_emit(globalconf.L, &global_signals, "exit", 1);
+ /* Move clients where we want them to be */
+ foreach(c, globalconf.clients)
+ {
+ xcb_reparent_window(globalconf.connection, (*c)->window, globalconf.screen->root,
+ (*c)->geometry.x, (*c)->geometry.y);
+ }
+
a_dbus_cleanup();
systray_cleanup();

View File

@ -1,56 +0,0 @@
$OpenBSD: patch-draw_c,v 1.1 2014/12/16 11:16:05 dcoppa Exp $
commit ed3d0489ced8c4f56d2af990979ba75cfa5107b8
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Dec 7 14:09:35 2014 +0100
Implement icon_pixmap and icon_mask from WM_HINTS (FS#1297)
Fun fact: ICCCM specifies that icon_pixmap must have depth 1. Xterm uses a
pixmap with depth 24. Yay... As such, I don't have any test for the depth == 1
case and will just assume that it does the right thing. If it doesn't, I bet no
one will notice anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- draw.c.orig Fri Apr 11 04:07:10 2014
+++ draw.c Tue Dec 16 04:47:13 2014
@@ -192,6 +192,18 @@ draw_surface_from_pixbuf(GdkPixbuf *buf)
return surface;
}
+static void
+get_surface_size(cairo_surface_t *surface, int *width, int *height)
+{
+ double x1, y1, x2, y2;
+ cairo_t *cr = cairo_create(surface);
+
+ cairo_clip_extents(cr, &x1, &y1, &x2, &y2);
+ cairo_destroy(cr);
+ *width = x2 - x1;
+ *height = y2 - y1;
+}
+
/** Duplicate the specified image surface.
* \param surface The surface to copy
* \return A pointer to a new cairo image surface.
@@ -199,10 +211,15 @@ draw_surface_from_pixbuf(GdkPixbuf *buf)
cairo_surface_t *
draw_dup_image_surface(cairo_surface_t *surface)
{
- cairo_surface_t *res = cairo_image_surface_create(
- cairo_image_surface_get_format(surface),
- cairo_image_surface_get_width(surface),
- cairo_image_surface_get_height(surface));
+ cairo_surface_t *res;
+ int width, height;
+
+ get_surface_size(surface, &width, &height);
+#if CAIRO_VERSION_MAJOR == 1 && CAIRO_VERSION_MINOR > 12
+ res = cairo_surface_create_similar_image(surface, CAIRO_FORMAT_ARGB32, width, height);
+#else
+ res = cairo_image_surface_create(CAIRO_FORMAT_ARGB32, width, height);
+#endif
cairo_t *cr = cairo_create(res);
cairo_set_source_surface(cr, surface, 0, 0);

View File

@ -1,67 +0,0 @@
$OpenBSD: patch-event_c,v 1.8 2014/12/16 11:16:05 dcoppa Exp $
commit 4073f8d88653032854136529da70e38daf6882be
Author: Uli Schlachter <psychon@znc.in>
Date: Mon Apr 21 10:41:07 2014 +0200
Call AllowEvents after grabbed events on a drawin
When we get an event due to a previous GrabButtons call, we have
to continue normal event processing again, because the server froze
the input device for us. Without this, everything appears to freeze.
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit f4a7b2d73a15adc03f705be689bf2713d1ac663e
Author: Uli Schlachter <psychon@znc.in>
Date: Fri Dec 5 18:40:06 2014 +0100
Don't move clients on ConfigureRequests (FS#1030)
I never saw a single program that set a border on its own windows. However,
awesome commonly sets borders on its clients and the position of a client is the
part outside of the border. So when processing a position request from a client,
we also have to include this border and fix things up correspondingly.
However, the same isn't needed for the client size, because the size does not
include the borders, but just the titlebar plus the "real" client content.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- event.c.orig Fri Apr 11 04:07:10 2014
+++ event.c Tue Dec 16 04:45:59 2014
@@ -196,6 +196,16 @@ event_handle_button(xcb_button_press_event_t *ev)
lua_pop(globalconf.L, 1);
/* check if any button object matches */
event_button_callback(ev, &drawin->buttons, -1, 1, NULL);
+ /* Either we are receiving this due to ButtonPress/Release on the root
+ * window or because we grabbed the button on the window. In the later
+ * case we have to call AllowEvents.
+ * Use AsyncPointer instead of ReplayPointer so that the event is
+ * "eaten" instead of being handled again on the root window.
+ */
+ if(ev->child == XCB_NONE)
+ xcb_allow_events(globalconf.connection,
+ XCB_ALLOW_ASYNC_POINTER,
+ XCB_CURRENT_TIME);
}
else if((c = client_getbyframewin(ev->event)))
{
@@ -289,9 +299,17 @@ event_handle_configurerequest(xcb_configure_request_ev
int16_t diff_w = 0, diff_h = 0, diff_border = 0;
if(ev->value_mask & XCB_CONFIG_WINDOW_X)
+ {
geometry.x = ev->x;
+ /* The ConfigureRequest specifies the position of the outer corner of the client window, we want the frame */
+ geometry.x -= c->border_width;
+ }
if(ev->value_mask & XCB_CONFIG_WINDOW_Y)
+ {
geometry.y = ev->y;
+ /* The ConfigureRequest specifies the position of the outer corner of the client window, we want the frame */
+ geometry.y -= c->border_width;
+ }
if(ev->value_mask & XCB_CONFIG_WINDOW_WIDTH)
{
uint16_t old_w = geometry.width;

View File

@ -1,20 +0,0 @@
$OpenBSD: patch-ewmh_c,v 1.1 2014/11/11 12:20:16 dcoppa Exp $
commit b0ede3108e4e4bb2f917f0c3fe607e86cb534b5a
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Mon May 5 23:12:21 2014 -0400
Add context to request::activate signal
--- ewmh.c.orig Fri Apr 11 11:07:10 2014
+++ ewmh.c Tue Nov 11 11:51:14 2014
@@ -422,7 +422,8 @@ ewmh_process_client_message(xcb_client_message_event_t
{
if((c = client_getbywin(ev->window))) {
luaA_object_push(globalconf.L, c);
- luaA_object_emit_signal(globalconf.L, -1, "request::activate", 0);
+ lua_pushstring(globalconf.L,"ewmh");
+ luaA_object_emit_signal(globalconf.L, -2, "request::activate", 1);
lua_pop(globalconf.L, 1);
}
}

View File

@ -1,34 +0,0 @@
$OpenBSD: patch-globalconf_h,v 1.6 2014/09/02 10:52:43 dcoppa Exp $
commit 9846a3274abe2569f342bb68af9b290799a8617e
Author: Uli Schlachter <psychon@znc.in>
Date: Wed Aug 20 11:40:50 2014 +0200
systray: Only intern the atom once
Let's just save the systray atom and keep it around. Why should we redo this
every time this atom is needed?
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit e21119023473fb45a11beb838d935b1c53cb550d
Author: Uli Schlachter <psychon@znc.in>
Date: Wed Aug 20 11:47:47 2014 +0200
systray: Only register/unregister when needed
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- globalconf.h.orig Fri Apr 11 11:07:10 2014
+++ globalconf.h Tue Sep 2 12:21:42 2014
@@ -121,6 +121,10 @@ typedef struct
struct
{
xcb_window_t window;
+ /** Atom for _NET_SYSTEM_TRAY_%d */
+ xcb_atom_t atom;
+ /** Do we own the systray selection? */
+ bool registered;
/** Systray window parent */
drawin_t *parent;
} systray;

View File

@ -1,33 +0,0 @@
$OpenBSD: patch-lib_awful_layout_suit_magnifier_lua_in,v 1.1 2014/11/11 12:20:16 dcoppa Exp $
commit 1f431384cbb428d97a6991ba0c59217cbc71b4a6
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Mon Oct 13 15:07:31 2014 -0400
layouts: Allow layouts to be invoked with fake data
This patch allows 2 things to be done:
* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag
The advantages of the former are clear and simple. Those of the later include:
* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
--- lib/awful/layout/suit/magnifier.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/awful/layout/suit/magnifier.lua.in Tue Nov 11 11:54:30 2014
@@ -23,8 +23,9 @@ function magnifier.arrange(p)
-- Fullscreen?
local area = p.workarea
local cls = p.clients
- local focus = capi.client.focus
- local mwfact = tag.getmwfact(tag.selected(p.screen))
+ local focus = p.focus or capi.client.focus
+ local t = p.tag or tag.selected(p.screen)
+ local mwfact = tag.getmwfact(t)
local fidx
-- Check that the focused window is on the right screen

View File

@ -1,30 +0,0 @@
$OpenBSD: patch-lib_awful_layout_suit_tile_lua_in,v 1.1 2014/11/11 12:20:16 dcoppa Exp $
commit 1f431384cbb428d97a6991ba0c59217cbc71b4a6
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Mon Oct 13 15:07:31 2014 -0400
layouts: Allow layouts to be invoked with fake data
This patch allows 2 things to be done:
* Write unit test to validate layouts using fake clients and tags
* Query the current layout geometry from another tag
The advantages of the former are clear and simple. Those of the later include:
* Creating a screenshot of another layout
* Display the layout wireframe in the tag list (like KDE2-3, Gnome2)
* Having and 'ALT-tab' like visual popup for tags
--- lib/awful/layout/suit/tile.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/awful/layout/suit/tile.lua.in Tue Nov 11 11:54:30 2014
@@ -74,7 +74,7 @@ local function tile_group(cls, wa, orientation, fact,
end
local function do_tile(param, orientation)
- local t = tag.selected(param.screen)
+ local t = param.tag or tag.selected(param.screen)
orientation = orientation or "right"
-- This handles all different orientations.

View File

@ -1,19 +0,0 @@
$OpenBSD: patch-lib_awful_rules_lua_in,v 1.1 2014/11/11 12:20:16 dcoppa Exp $
commit b0ede3108e4e4bb2f917f0c3fe607e86cb534b5a
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Mon May 5 23:12:21 2014 -0400
Add context to request::activate signal
--- lib/awful/rules.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/awful/rules.lua.in Tue Nov 11 11:51:14 2014
@@ -237,7 +237,7 @@ function rules.execute(c, props, callbacks)
-- Do this at last so we do not erase things done by the focus
-- signal.
if props.focus and (type(props.focus) ~= "function" or props.focus(c)) then
- c:emit_signal('request::activate')
+ c:emit_signal('request::activate',"rules")
end
end

View File

@ -1,195 +0,0 @@
$OpenBSD: patch-lib_awful_tag_lua_in,v 1.5 2014/11/11 12:20:16 dcoppa Exp $
commit 94cbc200edb0ae321610c3cbe09fd62c91dd5ba3
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Sat Nov 1 18:46:06 2014 -0400
tag: Improve tag property::index support (FS#1229)
* Move the "index" setting burden to individual functions
instead of gettags().
* Add some properties earlier so the signal hooks will be called
with valid data.
commit ed93b497b66f99de07f51b7410f4e34eeb4a5c74
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Mon Oct 13 21:36:11 2014 -0400
tag.delete: Do not reset client tag when unnecessary
commit f637265334259b29b3f959abfc133171e387b79c
Author: Emmanuel Lepage Vallee <elv1313@gmail.com>
Date: Mon Oct 13 15:00:09 2014 -0400
awful.tag.update: Fix identical tag set detection
If the "current" table is empty, then identical always true.
There is a lot of case where this can happen. Mostly when using
dynamic tagging.
--- lib/awful/tag.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/awful/tag.lua.in Tue Nov 11 11:53:22 2014
@@ -46,16 +46,20 @@ function tag.move(new_index, target_tag)
return
end
+ local rm_index = nil
+
for i, t in ipairs(tmp_tags) do
if t == target_tag then
table.remove(tmp_tags, i)
+ rm_index = i
break
end
end
table.insert(tmp_tags, new_index, target_tag)
- for i, tmp_tag in ipairs(tmp_tags) do
+ for i=new_index < rm_index and new_index or rm_index, #tmp_tags do
+ local tmp_tag = tmp_tags[i]
tag.setscreen(tmp_tag, scr)
tag.setproperty(tmp_tag, "index", i)
end
@@ -67,9 +71,23 @@ end
-- @return The created tag
function tag.add(name, props)
local properties = props or {}
- local newtag = capi.tag{ name = name, activated = true }
+
+ -- Be sure to set the screen before the tag is activated to avoid function
+ -- connected to property::activated to be called without a valid tag.
+ -- set properies cannot be used as this has to be set before the first signal
+ -- is sent
properties.screen = properties.screen or capi.mouse.screen
+ -- Index is also required
+ properties.index = (#tag.gettags(properties.screen))+1
+
+ local newtag = capi.tag{ name = name }
+
+ -- Start with a fresh property table to avoid collisions with unsupported data
+ data.tags[newtag] = {screen=properties.screen, index=properties.index}
+
+ newtag.activated = true
+
for k, v in pairs(properties) do
tag.setproperty(newtag, k, v)
end
@@ -121,10 +139,12 @@ end
function tag.delete(target_tag, fallback_tag)
-- abort if no tag is passed or currently selected
local target_tag = target_tag or tag.selected()
- if target_tag == nil then return end
+ if target_tag == nil or target_tag.activated == false then return end
local target_scr = tag.getscreen(target_tag)
- local ntags = #tag.gettags(target_scr)
+ local tags = tag.gettags(target_scr)
+ local idx = tag.getidx(target_tag)
+ local ntags = #tags
-- We can't use the target tag as a fallback.
local fallback_tag = fallback_tag
@@ -147,7 +167,8 @@ function tag.delete(target_tag, fallback_tag)
if (not c.sticky and #c:tags() == 1) or
(c.sticky and fallback_tag == nil) then
return
- else
+ -- If a client has multiple tags, then do not move it to fallback
+ elseif #c:tags() < 2 then
c:tags({fallback_tag})
end
end
@@ -156,11 +177,16 @@ function tag.delete(target_tag, fallback_tag)
data.tags[target_tag].screen = nil
target_tag.activated = false
+ -- Update all indexes
+ for i=idx+1,#tags do
+ tag.setproperty(tags[i], "index", i-1)
+ end
+
-- If no tags are visible, try and view one.
if tag.selected(target_scr) == nil and ntags > 0 then
tag.history.restore(nil, 1)
if tag.selected(target_scr) == nil then
- tag.gettags(target_scr)[1].selected = true
+ tags[tags[1] == target_tag and 2 or 1].selected = true
end
end
@@ -178,11 +204,13 @@ function tag.history.update(obj)
else
if data.history[s].current then
-- Check that the list is not identical
- local identical = true
- for idx, _tag in ipairs(data.history[s].current) do
- if curtags[idx] ~= _tag then
- identical = false
- break
+ local identical = #data.history[s].current == #curtags
+ if identical then
+ for idx, _tag in ipairs(data.history[s].current) do
+ if curtags[idx] ~= _tag then
+ identical = false
+ break
+ end
end
end
@@ -247,22 +275,9 @@ function tag.gettags(s)
end
end
- local without_index = 0
- for _, t in ipairs(tags) do
- if not tag.getproperty(t, "index") then
- without_index = without_index + 1
- end
- end
- if without_index > 0 then
- for _, t in ipairs(tags) do
- if not tag.getproperty(t, "index") then
- tag.setproperty(t, "index", (#tags - without_index + 1))
- without_index = without_index - 1
- end
- end
- end
-
- table.sort(tags, function(a, b) return tag.getproperty(a, "index") < tag.getproperty(b, "index") end)
+ table.sort(tags, function(a, b)
+ return (tag.getproperty(a, "index") or 9999) < (tag.getproperty(b, "index") or 9999)
+ end)
return tags
end
@@ -271,6 +286,7 @@ end
-- @param s Screen number
function tag.setscreen(t, s)
local s = s or capi.mouse.screen
+ local sel = tag.selected
local old_screen = tag.getproperty(t, "screen")
if s == old_screen then return end
@@ -285,7 +301,18 @@ function tag.setscreen(t, s)
c.screen = s --Move all clients
c:tags({t})
end
- tag.history.restore(old_screen,1)
+
+ -- Update all indexes
+ for _,screen in ipairs {old_screen,s} do
+ for i,t in ipairs(tag.gettags(screen)) do
+ tag.setproperty(t, "index", i)
+ end
+ end
+
+ -- Restore the old screen history if the tag was selected
+ if sel then
+ tag.history.restore(old_screen,1)
+ end
end
--- Get a tag's screen

View File

@ -1,43 +0,0 @@
$OpenBSD: patch-lib_awful_widget_button_lua_in,v 1.1 2014/09/22 09:24:55 dcoppa Exp $
commit 03b432cdff1146f30fa398b7ca6eb4a6b8e96f20
Author: Uli Schlachter <psychon@znc.in>
Date: Mon Sep 15 13:55:21 2014 +0200
awful.widget.button: Override :set_image() to do the right thing
Reported-at: http://article.gmane.org/gmane.comp.window-managers.awesome/10778
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- lib/awful/widget/button.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/awful/widget/button.lua.in Mon Sep 22 11:18:04 2014
@@ -24,15 +24,22 @@ function button.new(args)
if not args or not args.image then
return widget.empty_widget()
end
- local img_release = surface.load(args.image)
- local img_press = cairo.ImageSurface(cairo.Format.ARGB32, img_release.width, img_release.height)
- local cr = cairo.Context(img_press)
- cr:set_source_surface(img_release, 2, 2)
- cr:paint()
local w = imagebox()
- w:set_image(img_release)
- w:buttons(abutton({}, 1, function () w:set_image(img_press) end, function () w:set_image(img_release) end))
+ local orig_set_image = w.set_image
+ local img_release
+ local img_press
+
+ w.set_image = function(w, image)
+ img_release = surface.load(image)
+ img_press = img_release:create_similar(cairo.Content.COLOR_ALPHA, img_release.width, img_release.height)
+ local cr = cairo.Context(img_press)
+ cr:set_source_surface(img_release, 2, 2)
+ cr:paint()
+ orig_set_image(w, img_release)
+ end
+ w:set_image(args.image)
+ w:buttons(abutton({}, 1, function () orig_set_image(w, img_press) end, function () orig_set_image(w, img_release) end))
return w
end

View File

@ -1,55 +0,0 @@
$OpenBSD: patch-lib_awful_widget_taglist_lua_in,v 1.2 2014/09/02 10:52:43 dcoppa Exp $
commit 7a812fe28d624349e930203863753415f8d8ea49
Author: Evzen <actionless.loveless@gmail.com>
Date: Fri Jun 13 13:36:30 2014 +0200
fix(lib.awful.taglist): multiple tag selection
multiple tag selection wasn't highlighting properly when *_occupied
is set in theme table
commit aedcd90d4da41132303636ba15170b6a43cc231f
Author: Jason Yan <tailofthesun@gmail.com>
Date: Fri May 9 00:18:46 2014 -0700
Fix check against clients in taglist.
--- lib/awful/widget/taglist.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/awful/widget/taglist.lua.in Tue Sep 2 12:31:20 2014
@@ -51,10 +51,7 @@ function taglist.taglist_label(t, args)
local icon
local bg_resize = false
local is_selected = false
- if t.selected then
- bg_color = bg_focus
- fg_color = fg_focus
- end
+ local cls = t:clients()
if sel then
if taglist_squares_sel then
-- Check that the selected clients is tagged with 't'.
@@ -69,11 +66,10 @@ function taglist.taglist_label(t, args)
end
end
end
- if t:clients() == 0 and t.selected and taglist_squares_sel_empty then
+ if #cls == 0 and t.selected and taglist_squares_sel_empty then
bg_image = taglist_squares_sel_empty
bg_resize = taglist_squares_resize == "true"
elseif not is_selected then
- local cls = t:clients()
if #cls > 0 then
if taglist_squares_unsel then
bg_image = taglist_squares_unsel
@@ -96,6 +92,10 @@ function taglist.taglist_label(t, args)
break
end
end
+ end
+ if t.selected then
+ bg_color = bg_focus
+ fg_color = fg_focus
end
if not tag.getproperty(t, "icon_only") then
if fg_color then

View File

@ -1,27 +1,11 @@
$OpenBSD: patch-lib_menubar_menu_gen_lua_in,v 1.4 2014/09/02 10:52:43 dcoppa Exp $
commit a74b3fccaadace51c188768811b7b9e1fc37b904
Author: Sindre Foring Devik <sindre.devik@gmail.com>
Date: Mon Jun 30 15:08:43 2014 +0200
FS#1278 - Menubar should check all standard directories
Added local desktop directory to list of directories parsed by menubar
by using the XDG specification
--- lib/menubar/menu_gen.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/menubar/menu_gen.lua.in Tue Sep 2 11:59:59 2014
@@ -17,9 +17,14 @@ local menu_gen = {}
$OpenBSD: patch-lib_menubar_menu_gen_lua_in,v 1.5 2015/01/12 09:00:17 dcoppa Exp $
--- lib/menubar/menu_gen.lua.in.orig Sat Jan 10 13:36:35 2015
+++ lib/menubar/menu_gen.lua.in Mon Jan 12 02:31:10 2015
@@ -24,7 +24,7 @@ end
-- Options section
+local data_dir = os.getenv("XDG_DATA_HOME")
+if not data_dir then
+ data_dir = os.getenv("HOME") .. '/.local/share/'
+end
+
--- Specifies all directories where menubar should look for .desktop
-- files. The search is not recursive.
-menu_gen.all_menu_dirs = { '/usr/share/applications/', '/usr/local/share/applications/' }
-menu_gen.all_menu_dirs = { data_dir .. 'applications/', '/usr/share/applications/', '/usr/local/share/applications/' }
+menu_gen.all_menu_dirs = { data_dir .. 'applications/', '${LOCALBASE}/share/applications/' }
--- Specify the mapping of .desktop Categories section to the

View File

@ -1,29 +0,0 @@
$OpenBSD: patch-lib_wibox_init_lua_in,v 1.1 2014/09/02 10:52:43 dcoppa Exp $
commit 19252f87fe687b1c8525116c98cf24e52e83560a
Author: Uli Schlachter <psychon@znc.in>
Date: Wed Aug 20 11:26:09 2014 +0200
wibox: Make :find_widgets() easily accessible
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- lib/wibox/init.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/wibox/init.lua.in Tue Sep 2 12:07:29 2014
@@ -48,6 +48,16 @@ function wibox:set_fg(c)
self._drawable:set_fg(c)
end
+--- Find a widget by a point.
+-- The wibox must have drawn itself at least once for this to work.
+-- @param x X coordinate of the point
+-- @param y Y coordinate of the point
+-- @return A sorted table with all widgets that contain the given point. The
+-- widgets are sorted by relevance.
+function wibox:find_widgets(x, y)
+ return self._drawable:find_widgets(x, y)
+end
+
for _, k in pairs{ "buttons", "struts", "geometry", "get_xproperty", "set_xproperty" } do
wibox[k] = function(self, ...)
return self.drawin[k](self.drawin, ...)

View File

@ -1,46 +0,0 @@
$OpenBSD: patch-lib_wibox_layout_base_lua_in,v 1.1 2014/10/13 09:00:48 dcoppa Exp $
commit 983d094c76c5ddb6fe7deeec2f977a981c057a8a
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Oct 5 10:47:39 2014 +0200
wibox.layout.base.rect_to_device_geometry: Fix for "weird" rotations
The old code transformed the top-left and bottom-right corner of
the rectangle to device space and calculated a rectangle based on
these two points. However, if you rotate a rectangle by 45 degrees,
these two points will be directly above each other and thus the old
code would calculate a width of 0.
Fix this by transforming all four corners of the rectangle into
device space and calculating a rectangle based on this.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- lib/wibox/layout/base.lua.in.orig Fri Apr 11 11:07:10 2014
+++ lib/wibox/layout/base.lua.in Tue Oct 7 13:37:21 2014
@@ -13,15 +13,17 @@ local max = math.max
-- wibox.layout.base
local base = {}
---- Figure out the geometry in device coordinate space. This will break if
--- someone rotates the coordinate space by a non-multiple of 90°.
+--- Figure out the geometry in device coordinate space. This gives only tight
+-- bounds if no rotations by non-multiples of 90 degrees are used.
function base.rect_to_device_geometry(cr, x, y, width, height)
local x1, y1 = cr:user_to_device(x, y)
- local x2, y2 = cr:user_to_device(x + width, y + height)
- local x = min(x1, x2)
- local y = min(y1, y2)
- local width = max(x1, x2) - x
- local height = max(y1, y2) - y
+ local x2, y2 = cr:user_to_device(x, y + height)
+ local x3, y3 = cr:user_to_device(x + width, y + height)
+ local x4, y4 = cr:user_to_device(x + width, y)
+ local x = min(x1, x2, x3, x4)
+ local y = min(y1, y2, y3, y4)
+ local width = max(x1, x2, x3, x4) - x
+ local height = max(y1, y2, y3, y4) - y
return x, y, width, height
end

View File

@ -1,123 +0,0 @@
$OpenBSD: patch-objects_client_c,v 1.9 2014/12/16 11:16:05 dcoppa Exp $
commit a44b3a2daffa52640a2be20b904156abf1c585e5
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Mar 30 14:58:03 2014 +0200
Don't set a background-pixel for our client frame windows
Previously we would get a short black flicker when a client closes. This
happened because first the client's window would get hidden and only a short
moment later would awesome react to this and close its own window. In the mean
time, the X server filled the frame window with its background-pixel which was
black.
Just removing the background-pixel means we get the default value which is None.
This means that the content will be left untouched and the client's window will
be visible for a moment longer.
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit ed3d0489ced8c4f56d2af990979ba75cfa5107b8
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Dec 7 14:09:35 2014 +0100
Implement icon_pixmap and icon_mask from WM_HINTS (FS#1297)
Fun fact: ICCCM specifies that icon_pixmap must have depth 1. Xterm uses a
pixmap with depth 24. Yay... As such, I don't have any test for the depth == 1
case and will just assume that it does the right thing. If it doesn't, I bet no
one will notice anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- objects/client.c.orig Fri Apr 11 04:07:10 2014
+++ objects/client.c Tue Dec 16 04:47:44 2014
@@ -455,13 +455,11 @@ client_manage(xcb_window_t w, xcb_get_geometry_reply_t
xcb_create_window(globalconf.connection, globalconf.default_depth, c->frame_window, s->root,
wgeom->x, wgeom->y, wgeom->width, wgeom->height,
wgeom->border_width, XCB_COPY_FROM_PARENT, globalconf.visual->visual_id,
- XCB_CW_BACK_PIXEL | XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY
- | XCB_CW_WIN_GRAVITY | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK
- | XCB_CW_COLORMAP,
+ XCB_CW_BORDER_PIXEL | XCB_CW_BIT_GRAVITY | XCB_CW_WIN_GRAVITY
+ | XCB_CW_OVERRIDE_REDIRECT | XCB_CW_EVENT_MASK | XCB_CW_COLORMAP,
(const uint32_t [])
{
globalconf.screen->black_pixel,
- globalconf.screen->black_pixel,
XCB_GRAVITY_NORTH_WEST,
XCB_GRAVITY_NORTH_WEST,
1,
@@ -1311,6 +1309,71 @@ client_set_icon(client_t *c, cairo_surface_t *s)
luaA_object_emit_signal(globalconf.L, -1, "property::icon", 0);
lua_pop(globalconf.L, 1);
}
+
+/** Set a client icon.
+ * \param c The client to change.
+ * \param icon A bitmap containing the icon.
+ * \param mask A mask for the bitmap (optional)
+ */
+void
+client_set_icon_from_pixmaps(client_t *c, xcb_pixmap_t icon, xcb_pixmap_t mask)
+{
+ xcb_get_geometry_cookie_t geom_icon_c, geom_mask_c;
+ xcb_get_geometry_reply_t *geom_icon_r, *geom_mask_r = NULL;
+ cairo_surface_t *s_icon, *result;
+
+ geom_icon_c = xcb_get_geometry_unchecked(globalconf.connection, icon);
+ if (mask)
+ geom_mask_c = xcb_get_geometry_unchecked(globalconf.connection, mask);
+ geom_icon_r = xcb_get_geometry_reply(globalconf.connection, geom_icon_c, NULL);
+ if (mask)
+ geom_mask_r = xcb_get_geometry_reply(globalconf.connection, geom_mask_c, NULL);
+
+ if (!geom_icon_r || (mask && !geom_mask_r))
+ goto out;
+ if ((geom_icon_r->depth != 1 && geom_icon_r->depth != globalconf.screen->root_depth)
+ || (geom_mask_r && geom_mask_r->depth != 1))
+ {
+ warn("Got pixmaps with depth (%d, %d) while processing icon, but only depth 1 and %d are allowed",
+ geom_icon_r->depth, geom_mask_r ? geom_mask_r->depth : 0, globalconf.screen->root_depth);
+ goto out;
+ }
+
+ if (geom_icon_r->depth == 1)
+ s_icon = cairo_xcb_surface_create_for_bitmap(globalconf.connection,
+ globalconf.screen, icon, geom_icon_r->width, geom_icon_r->height);
+ else
+ s_icon = cairo_xcb_surface_create(globalconf.connection, icon, globalconf.default_visual,
+ geom_icon_r->width, geom_icon_r->height);
+ result = s_icon;
+
+ if (mask)
+ {
+ cairo_surface_t *s_mask;
+ cairo_t *cr;
+
+ result = cairo_surface_create_similar(s_icon, CAIRO_CONTENT_COLOR_ALPHA, geom_icon_r->width, geom_icon_r->height);
+ s_mask = cairo_xcb_surface_create_for_bitmap(globalconf.connection,
+ globalconf.screen, mask, geom_icon_r->width, geom_icon_r->height);
+ cr = cairo_create(result);
+
+ cairo_set_source_surface(cr, s_icon, 0, 0);
+ cairo_mask_surface(cr, s_mask, 0, 0);
+ cairo_surface_destroy(s_mask);
+ cairo_destroy(cr);
+ }
+
+ client_set_icon(c, result);
+
+ cairo_surface_destroy(result);
+ if (result != s_icon)
+ cairo_surface_destroy(s_icon);
+
+out:
+ p_delete(&geom_icon_r);
+ p_delete(&geom_mask_r);
+}
+
/** Kill a client.
* \param L The Lua VM state.

View File

@ -1,36 +0,0 @@
$OpenBSD: patch-objects_client_h,v 1.5 2014/12/16 11:16:05 dcoppa Exp $
commit ed3d0489ced8c4f56d2af990979ba75cfa5107b8
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Dec 7 14:09:35 2014 +0100
Implement icon_pixmap and icon_mask from WM_HINTS (FS#1297)
Fun fact: ICCCM specifies that icon_pixmap must have depth 1. Xterm uses a
pixmap with depth 24. Yay... As such, I don't have any test for the depth == 1
case and will just assume that it does the right thing. If it doesn't, I bet no
one will notice anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- objects/client.h.orig Fri Apr 11 04:07:10 2014
+++ objects/client.h Tue Dec 16 04:47:13 2014
@@ -106,6 +106,8 @@ struct client_t
key_array_t keys;
/** Icon */
cairo_surface_t *icon;
+ /** True if we ever got an icon from _NET_WM_ICON */
+ bool have_ewmh_icon;
/** Size hints */
xcb_size_hints_t size_hints;
bool size_hints_honor;
@@ -166,7 +168,8 @@ void client_set_transient_for(lua_State *L, int, clien
void client_set_name(lua_State *L, int, char *);
void client_set_alt_name(lua_State *L, int, char *);
void client_set_group_window(lua_State *, int, xcb_window_t);
-void client_set_icon(client_t *c, cairo_surface_t *s);
+void client_set_icon(client_t *, cairo_surface_t *);
+void client_set_icon_from_pixmaps(client_t *, xcb_pixmap_t, xcb_pixmap_t);
void client_set_skip_taskbar(lua_State *, int, bool);
void client_focus(client_t *);
void client_focus_update(client_t *);

View File

@ -1,84 +0,0 @@
$OpenBSD: patch-objects_drawin_c,v 1.5 2014/10/13 09:00:48 dcoppa Exp $
commit f236a5f0c70015c0c2b3a57a8aec9dcc5dc49bdc
Author: Uli Schlachter <psychon@znc.in>
Date: Sat Oct 11 13:27:29 2014 +0200
drawin_update_drawing: Remove optimization for invisible drawins
This fixes the following code:
local d = drawin({})
d.visible = true
The drawin now has a cairo surface assigned
d.visible = false
d.width = 1234
d.visible = true
The width change while the drawin was not visible would not get propagated to
the drawable because of the code that this patch removes. The expectation was
that drawin_map() would update the drawable later.
However, because the drawin was already visible, its drawable also already has
a surface assigned. Thus, drawin_map() wouldn't update the drawable either.
Fix this by just removing this optimizations.
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit 6673ecb167c5a5d85c8bacab15c1b6c0c7f65e80
Author: Uli Schlachter <psychon@znc.in>
Date: Sat Oct 11 13:12:57 2014 +0200
drawin: Don't special-case moves
The code in drawin_moveresize() tries to be clever and only updates the drawing
state of the drawable when it is resized, not when it is moved around. This used
to be necessary because once upon a time, drawin_update_drawing() threw away all
of the drawing state and thus forcing a repaint. These days it just calls
drawable_set_geometry() as well and that function special-cases moves.
So this old code in drawin_moveresize() is no longer necessary and actually
caused problems.
These problems occurred because drawin_update_drawing() is being clever and
doesn't do anything for .visible = false drawins, because their drawing state
will be updated once they become visible. However, not skipping
drawable_set_geometry() means that this broke, because drawin_map() thought that
the drawing state was up to date while in reality it wasn't.
References: http://article.gmane.org/gmane.comp.window-managers.awesome/10852
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- objects/drawin.c.orig Fri Apr 11 11:07:10 2014
+++ objects/drawin.c Mon Oct 13 10:39:02 2014
@@ -82,11 +82,6 @@ drawin_unref_simplified(drawin_t **item)
static void
drawin_update_drawing(drawin_t *w, int widx)
{
- /* If this drawin isn't visible, we don't need an up-to-date cairo surface
- * for it. (drawin_map() will later make sure we are called again) */
- if(!w->visible)
- return;
-
luaA_object_push_item(globalconf.L, widx, w->drawable);
drawable_set_geometry(w->drawable, -1, w->geometry);
lua_pop(globalconf.L, 1);
@@ -137,14 +132,7 @@ drawin_moveresize(lua_State *L, int udx, area_t geomet
mask_vals |= XCB_CONFIG_WINDOW_HEIGHT;
}
- if(mask_vals & (XCB_CONFIG_WINDOW_WIDTH | XCB_CONFIG_WINDOW_HEIGHT))
- drawin_update_drawing(w, udx);
- else {
- /* We still have to set x/y */
- luaA_object_push_item(L, udx, w->drawable);
- drawable_set_geometry(w->drawable, -1, w->geometry);
- lua_pop(L, 1);
- }
+ drawin_update_drawing(w, udx);
/* Activate BMA */
client_ignore_enterleave_events();

View File

@ -1,45 +0,0 @@
$OpenBSD: patch-property_c,v 1.9 2014/12/16 11:16:05 dcoppa Exp $
commit ed3d0489ced8c4f56d2af990979ba75cfa5107b8
Author: Uli Schlachter <psychon@znc.in>
Date: Sun Dec 7 14:09:35 2014 +0100
Implement icon_pixmap and icon_mask from WM_HINTS (FS#1297)
Fun fact: ICCCM specifies that icon_pixmap must have depth 1. Xterm uses a
pixmap with depth 24. Yay... As such, I don't have any test for the depth == 1
case and will just assume that it does the right thing. If it doesn't, I bet no
one will notice anyway.
Signed-off-by: Uli Schlachter <psychon@znc.in>
--- property.c.orig Fri Apr 11 04:07:10 2014
+++ property.c Tue Dec 16 04:47:13 2014
@@ -205,6 +205,19 @@ property_update_wm_hints(client_t *c, xcb_get_property
if(wmh.flags & XCB_ICCCM_WM_HINT_WINDOW_GROUP)
client_set_group_window(globalconf.L, -1, wmh.window_group);
+ if(!c->have_ewmh_icon)
+ {
+ if(wmh.flags & XCB_ICCCM_WM_HINT_ICON_PIXMAP)
+ {
+ if(wmh.flags & XCB_ICCCM_WM_HINT_ICON_MASK)
+ client_set_icon_from_pixmaps(c, wmh.icon_pixmap, wmh.icon_mask);
+ else
+ client_set_icon_from_pixmaps(c, wmh.icon_pixmap, XCB_NONE);
+ }
+ else
+ client_set_icon(c, NULL);
+ }
+
lua_pop(globalconf.L, 1);
}
@@ -261,6 +274,7 @@ property_update_net_wm_icon(client_t *c, xcb_get_prope
if(!surface)
return;
+ c->have_ewmh_icon = true;
client_set_icon(c, surface);
cairo_surface_destroy(surface);
}

View File

@ -1,197 +0,0 @@
$OpenBSD: patch-systray_c,v 1.5 2014/09/02 10:52:43 dcoppa Exp $
commit 9846a3274abe2569f342bb68af9b290799a8617e
Author: Uli Schlachter <psychon@znc.in>
Date: Wed Aug 20 11:40:50 2014 +0200
systray: Only intern the atom once
Let's just save the systray atom and keep it around. Why should we redo this
every time this atom is needed?
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit e21119023473fb45a11beb838d935b1c53cb550d
Author: Uli Schlachter <psychon@znc.in>
Date: Wed Aug 20 11:47:47 2014 +0200
systray: Only register/unregister when needed
Signed-off-by: Uli Schlachter <psychon@znc.in>
commit aec8e2944a220f8cb46f37826acd88506af5b243
Author: memeplex <carlosjosepita@gmail.com>
Date: Mon Aug 18 02:32:11 2014 -0300
Fix for FS#1293
FS#1293 - Systray won't show with margin layout
commit a250dcdbe12a3afa6ffa9fbb26f8c48c7e9cc049
Author: Uli Schlachter <psychon@znc.in>
Date: Sun May 11 17:21:57 2014 +0200
systray: Small consistency fixes
Use lua's *integer instead of *number functions, because we are dealing with
integers. That is, "numbers which do not have a fractional part".
--- systray.c.orig Fri Apr 11 11:07:10 2014
+++ systray.c Tue Sep 2 12:21:42 2014
@@ -39,6 +39,9 @@
void
systray_init(void)
{
+ xcb_intern_atom_cookie_t atom_systray_q;
+ xcb_intern_atom_reply_t *atom_systray_r;
+ char *atom_name;
xcb_screen_t *xscreen = globalconf.screen;
globalconf.systray.window = xcb_generate_id(globalconf.connection);
@@ -48,6 +51,22 @@ systray_init(void)
-1, -1, 1, 1, 0,
XCB_COPY_FROM_PARENT, xscreen->root_visual,
0, NULL);
+
+ atom_name = xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", globalconf.default_screen);
+ if(!atom_name)
+ fatal("error getting systray atom name");
+
+ atom_systray_q = xcb_intern_atom_unchecked(globalconf.connection, false,
+ a_strlen(atom_name), atom_name);
+
+ p_delete(&atom_name);
+
+ atom_systray_r = xcb_intern_atom_reply(globalconf.connection, atom_systray_q, NULL);
+ if(!atom_systray_r)
+ fatal("error getting systray atom");
+
+ globalconf.systray.atom = atom_systray_r->atom;
+ p_delete(&atom_systray_r);
}
/** Register systray in X.
@@ -57,23 +76,12 @@ systray_register(void)
{
xcb_client_message_event_t ev;
xcb_screen_t *xscreen = globalconf.screen;
- char *atom_name;
- xcb_intern_atom_cookie_t atom_systray_q;
- xcb_intern_atom_reply_t *atom_systray_r;
- xcb_atom_t atom_systray;
- /* Send requests */
- if(!(atom_name = xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", globalconf.default_screen)))
- {
- warn("error getting systray atom");
+ if(globalconf.systray.registered)
return;
- }
- atom_systray_q = xcb_intern_atom_unchecked(globalconf.connection, false,
- a_strlen(atom_name), atom_name);
+ globalconf.systray.registered = true;
- p_delete(&atom_name);
-
/* Fill event */
p_clear(&ev, 1);
ev.response_type = XCB_CLIENT_MESSAGE;
@@ -81,22 +89,13 @@ systray_register(void)
ev.format = 32;
ev.type = MANAGER;
ev.data.data32[0] = XCB_CURRENT_TIME;
+ ev.data.data32[1] = globalconf.systray.atom;
ev.data.data32[2] = globalconf.systray.window;
ev.data.data32[3] = ev.data.data32[4] = 0;
- if(!(atom_systray_r = xcb_intern_atom_reply(globalconf.connection, atom_systray_q, NULL)))
- {
- warn("error getting systray atom");
- return;
- }
-
- ev.data.data32[1] = atom_systray = atom_systray_r->atom;
-
- p_delete(&atom_systray_r);
-
xcb_set_selection_owner(globalconf.connection,
globalconf.systray.window,
- atom_systray,
+ globalconf.systray.atom,
XCB_CURRENT_TIME);
xcb_send_event(globalconf.connection, false, xscreen->root, 0xFFFFFF, (char *) &ev);
@@ -107,31 +106,16 @@ systray_register(void)
void
systray_cleanup(void)
{
- xcb_intern_atom_reply_t *atom_systray_r;
- char *atom_name;
-
- if(!(atom_name = xcb_atom_name_by_screen("_NET_SYSTEM_TRAY", globalconf.default_screen))
- || !(atom_systray_r = xcb_intern_atom_reply(globalconf.connection,
- xcb_intern_atom_unchecked(globalconf.connection,
- false,
- a_strlen(atom_name),
- atom_name),
- NULL)))
- {
- warn("error getting systray atom");
- p_delete(&atom_name);
+ if(!globalconf.systray.registered)
return;
- }
- p_delete(&atom_name);
+ globalconf.systray.registered = false;
xcb_set_selection_owner(globalconf.connection,
XCB_NONE,
- atom_systray_r->atom,
+ globalconf.systray.atom,
XCB_CURRENT_TIME);
- p_delete(&atom_systray_r);
-
xcb_unmap_window(globalconf.connection,
globalconf.systray.window);
}
@@ -325,13 +309,15 @@ systray_update(int base_size, bool horizontal, bool re
int
luaA_systray(lua_State *L)
{
+ systray_register();
+
if(lua_gettop(L) != 0)
{
size_t bg_len;
drawin_t *w = luaA_checkudata(L, 1, &drawin_class);
- int x = luaL_checknumber(L, 2);
- int y = luaL_checknumber(L, 3);
- int base_size = luaL_checknumber(L, 4);
+ int x = luaL_checkinteger(L, 2);
+ int y = luaL_checkinteger(L, 3);
+ int base_size = luaL_checkinteger(L, 4);
bool horiz = lua_toboolean(L, 5);
const char *bg = luaL_checklstring(L, 6, &bg_len);
bool revers = lua_toboolean(L, 7);
@@ -345,9 +331,6 @@ luaA_systray(lua_State *L)
XCB_CW_BACK_PIXEL, config_back);
}
- if(globalconf.systray.parent == NULL)
- systray_register();
-
if(globalconf.systray.parent != w)
xcb_reparent_window(globalconf.connection,
globalconf.systray.window,
@@ -375,7 +358,7 @@ luaA_systray(lua_State *L)
globalconf.systray.window);
}
- lua_pushnumber(L, globalconf.embedded.len);
+ lua_pushinteger(L, globalconf.embedded.len);
luaA_object_push(L, globalconf.systray.parent);
return 2;
}