Skip to content

Commit 1f77055

Browse files
authored
Merge branch 'awesomeWM:master' into fix-firefox-fullscreen-stack
2 parents eed17d0 + 4960086 commit 1f77055

30 files changed

+546
-262
lines changed

.github/ISSUE_TEMPLATE/1-bug.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository
2+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
3+
name: Bug Report
4+
description: File a bug report.
5+
labels: ["bug", "triage"]
6+
projects: ["awesomeWM/awesome"]
7+
type: bug
8+
body:
9+
- type: markdown
10+
attributes:
11+
value: |
12+
Thanks for taking the time to fill out this bug report!
13+
- type: textarea
14+
id: what-happened
15+
attributes:
16+
label: How to reproduce the issue?
17+
description: step-by-step instructions on what to do
18+
placeholder: 1) ... 2) ... 3) PROFIT
19+
validations:
20+
required: true
21+
- type: textarea
22+
id: awesome-version-output
23+
attributes:
24+
label: "Output of `awesome --version`"
25+
description: please use FULL command output, not version only
26+
placeholder: paste it here
27+
validations:
28+
required: true
29+
- type: textarea
30+
id: result-actual
31+
attributes:
32+
label: Actual Result
33+
placeholder: what happened
34+
validations:
35+
required: false
36+
- type: textarea
37+
id: result-expected
38+
attributes:
39+
label: Expected Result
40+
placeholder: what should happen
41+
validations:
42+
required: false
43+
- type: checkboxes
44+
id: debug-config
45+
attributes:
46+
label: Default Config File
47+
description: Can you reproduce the same issue with default config file
48+
options:
49+
- label: "I can reproduce the same problem with default `rc.lua` file"
50+
- type: checkboxes
51+
id: debug-argb
52+
attributes:
53+
label: ARGB mode
54+
description: "If you experience visual glitches, have you tried running AwesomeWM with `--no-argb` flag."
55+
options:
56+
- label: "I experience visual glitches and tried running AwesomeWM in no-argb mode and still can reproduce the problem"
57+
- type: textarea
58+
# @TODO: add common steps for debugging and retrieve extra info from clients etc
59+
id: logs
60+
attributes:
61+
label: Relevant log output
62+
description: Please copy and paste any relevant log output. This will be automatically formatted into code, so no need for backticks.
63+
render: shell
64+
validations:
65+
required: false
66+
- type: upload
67+
id: screenshots
68+
attributes:
69+
label: Upload screenshots
70+
description: If applicable, add screenshots to help explain your problem.
71+
validations:
72+
required: false
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/configuring-issue-templates-for-your-repository
2+
# https://docs.github.com/en/communities/using-templates-to-encourage-useful-issues-and-pull-requests/syntax-for-githubs-form-schema
3+
name: Feature Request
4+
description: Propose a new feature.
5+
labels: ["feature", "triage"]
6+
projects: ["awesomeWM/awesome"]
7+
type: feature
8+
body:
9+
- type: markdown
10+
attributes:
11+
value: |
12+
Thanks for taking the time to fill out this feature request!
13+
- type: textarea
14+
id: what-happened
15+
attributes:
16+
label: Describe your idea
17+
validations:
18+
required: true
19+
- type: upload
20+
id: screenshots
21+
attributes:
22+
label: Upload screenshots
23+
description: If applicable, add screenshots to help explain your idea.
24+
validations:
25+
required: false

ISSUE_TEMPLATE.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

awesome.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ awesome_atexit(bool restart)
123123
}
124124

125125
/* Save the client order. This is useful also for "hard" restarts. */
126-
xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.clients.len);
126+
xcb_window_t wins[globalconf.clients.len];
127127
int n = 0;
128128
foreach(client, globalconf.clients)
129129
wins[n++] = (*client)->window;
@@ -568,7 +568,7 @@ true_config_callback(const char *unused)
568568
int
569569
main(int argc, char **argv)
570570
{
571-
string_array_t searchpath;
571+
string_array_t searchpath = {};
572572
int xfd;
573573
xdgHandle xdg;
574574
xcb_query_tree_cookie_t tree_c;
@@ -587,7 +587,6 @@ main(int argc, char **argv)
587587
globalconf.exit_code = EXIT_SUCCESS;
588588
globalconf.api_level = awesome_default_api_level();
589589
buffer_init(&globalconf.startup_errors);
590-
string_array_init(&searchpath);
591590

592591
/* save argv */
593592
awesome_argv = argv;
@@ -610,8 +609,8 @@ main(int argc, char **argv)
610609
for(; *xdgconfigdirs; xdgconfigdirs++)
611610
{
612611
/* Append /awesome to *xdgconfigdirs */
613-
const char *suffix = "/awesome";
614-
size_t len = a_strlen(*xdgconfigdirs) + a_strlen(suffix) + 1;
612+
const char suffix[] = "/awesome";
613+
size_t len = a_strlen(*xdgconfigdirs) + sizeof(suffix);
615614
char *entry = p_new(char, len);
616615
a_strcat(entry, len, *xdgconfigdirs);
617616
a_strcat(entry, len, suffix);

common/array.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@
142142
pfx##_array_splice(arr, r, 0, &e, 1); \
143143
} \
144144
static inline void \
145-
pfx##_array_inserts(pfx##_array_t *arr, type_t items[], int count) \
145+
pfx##_array_inserts(pfx##_array_t *arr, const type_t items[], int count)\
146146
{ \
147147
pfx##_array_growx(arr, arr->len + count); \
148148
memcpy(arr->tab + arr->len, items, count * sizeof(*items)); \

common/luaclass.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,8 @@ luaA_class_add_property(lua_class_t *lua_class,
155155

156156
void
157157
luaA_class_add_properties(lua_class_t* lua_class,
158-
lua_class_property_t properties[],
159-
size_t count)
158+
const lua_class_property_t properties[],
159+
int count)
160160
{
161161
lua_class_property_array_inserts(&lua_class->properties, properties, count);
162162
}
@@ -302,7 +302,7 @@ luaA_class_connect_signal_from_stack(lua_State *L, lua_class_t *lua_class,
302302
/* Duplicate the function in the stack */
303303
lua_pushvalue(L, ud);
304304

305-
char *buf = p_alloca(char, a_strlen(name) + a_strlen(CONNECTED_SUFFIX) + 1);
305+
char buf[a_strlen(name) + a_strlen(CONNECTED_SUFFIX) + 1];
306306

307307
/* Create a new signal to notify there is a global connection. */
308308
sprintf(buf, "%s%s", name, CONNECTED_SUFFIX);

common/luaclass.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ void luaA_class_setup(lua_State *, lua_class_t *, const char *, lua_class_t *,
108108

109109
void luaA_class_add_property(lua_class_t *, const char *,
110110
lua_class_propfunc_t, lua_class_propfunc_t, lua_class_propfunc_t);
111-
void luaA_class_add_properties(lua_class_t *, lua_class_property_t[] , size_t);
111+
void luaA_class_add_properties(lua_class_t *, const lua_class_property_t[] , int);
112112

113113
int luaA_usemetatable(lua_State *, int, int);
114114
int luaA_class_index(lua_State *);

common/util.h

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,6 @@
3232
#include <assert.h>
3333
#include <stdio.h>
3434

35-
#if !(defined (__FreeBSD__) || defined(__OpenBSD__) || defined(__NetBSD__) || defined (__DragonFly__))
36-
#include <alloca.h>
37-
#endif
38-
3935
/** \brief replace \c NULL strings with empty strings */
4036
#define NONULL(x) (x ? x : "")
4137

@@ -59,10 +55,6 @@
5955
#define fieldsizeof(type_t, m) sizeof(((type_t *)0)->m)
6056
#define fieldtypeof(type_t, m) typeof(((type_t *)0)->m)
6157

62-
#define p_alloca(type, count) \
63-
((type *)memset(alloca(sizeof(type) * (count)), \
64-
0, sizeof(type) * (count)))
65-
6658
#define p_alloc_nr(x) (((x) + 16) * 3 / 2)
6759
#define p_new(type, count) ((type *)xmalloc(sizeof(type) * (count)))
6860
#define p_clear(p, count) ((void)memset((p), 0, sizeof(*(p)) * (count)))

event.c

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -392,25 +392,25 @@ event_handle_configurerequest(xcb_configure_request_event_t *ev)
392392

393393
/* Request the changes to be applied */
394394
luaA_object_push(L, c);
395-
lua_pushstring(L, "ewmh"); /* context */
395+
lua_pushliteral(L, "ewmh"); /* context */
396396
lua_newtable(L); /* props */
397397

398398
/* area, it needs to be directly in the `hints` table to comply with
399399
the "protocol"
400400
*/
401-
lua_pushstring(L, "x");
401+
lua_pushliteral(L, "x");
402402
lua_pushinteger(L, geometry.x);
403403
lua_rawset(L, -3);
404404

405-
lua_pushstring(L, "y");
405+
lua_pushliteral(L, "y");
406406
lua_pushinteger(L, geometry.y);
407407
lua_rawset(L, -3);
408408

409-
lua_pushstring(L, "width");
409+
lua_pushliteral(L, "width");
410410
lua_pushinteger(L, geometry.width);
411411
lua_rawset(L, -3);
412412

413-
lua_pushstring(L, "height");
413+
lua_pushliteral(L, "height");
414414
lua_pushinteger(L, geometry.height);
415415
lua_rawset(L, -3);
416416

@@ -898,7 +898,6 @@ event_handle_randr_output_change_notify(xcb_randr_notify_event_t *ev)
898898
if(ev->subCode == XCB_RANDR_NOTIFY_OUTPUT_CHANGE) {
899899
xcb_randr_output_t output = ev->u.oc.output;
900900
uint8_t connection = ev->u.oc.connection;
901-
const char *connection_str = NULL;
902901
xcb_randr_get_output_info_reply_t *info;
903902
lua_State *L = globalconf_get_lua_State();
904903

@@ -914,20 +913,19 @@ event_handle_randr_output_change_notify(xcb_randr_notify_event_t *ev)
914913
if(!info)
915914
return;
916915

917-
switch(connection) {
918-
case XCB_RANDR_CONNECTION_CONNECTED:
919-
connection_str = "Connected";
920-
break;
921-
case XCB_RANDR_CONNECTION_DISCONNECTED:
922-
connection_str = "Disconnected";
923-
break;
924-
default:
925-
connection_str = "Unknown";
926-
break;
916+
lua_pushlstring(L, (char*)xcb_randr_get_output_info_name(info), xcb_randr_get_output_info_name_length(info));
917+
switch (connection) {
918+
case XCB_RANDR_CONNECTION_CONNECTED:
919+
lua_pushliteral(L, "Connected");
920+
break;
921+
case XCB_RANDR_CONNECTION_DISCONNECTED:
922+
lua_pushliteral(L, "Disconnected");
923+
break;
924+
default:
925+
lua_pushliteral(L, "Unknown");
926+
break;
927927
}
928928

929-
lua_pushlstring(L, (char *)xcb_randr_get_output_info_name(info), xcb_randr_get_output_info_name_length(info));
930-
lua_pushstring(L, connection_str);
931929
signal_object_emit(L, &global_signals, "screen::change", 2);
932930

933931
p_delete(&info);

ewmh.c

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ ewmh_update_net_active_window(lua_State *L)
9494
static int
9595
ewmh_update_net_client_list(lua_State *L)
9696
{
97-
xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.clients.len);
97+
xcb_window_t wins[globalconf.clients.len];
9898

9999
int n = 0;
100100
foreach(client, globalconf.clients)
@@ -215,16 +215,16 @@ ewmh_update_maximize(bool h, bool status, bool toggle)
215215
lua_State *L = globalconf_get_lua_State();
216216

217217
if (h)
218-
lua_pushstring(L, "client_maximize_horizontal");
218+
lua_pushliteral(L, "client_maximize_horizontal");
219219
else
220-
lua_pushstring(L, "client_maximize_vertical");
220+
lua_pushliteral(L, "client_maximize_vertical");
221221

222222
/* Create table argument with raise=true. */
223223
lua_newtable(L);
224-
lua_pushstring(L, "toggle");
224+
lua_pushliteral(L, "toggle");
225225
lua_pushboolean(L, toggle);
226226
lua_settable(L, -3);
227-
lua_pushstring(L, "status");
227+
lua_pushliteral(L, "status");
228228
lua_pushboolean(L, status);
229229
lua_settable(L, -3);
230230

@@ -271,7 +271,7 @@ void
271271
ewmh_update_net_client_list_stacking(void)
272272
{
273273
int n = 0;
274-
xcb_window_t *wins = p_alloca(xcb_window_t, globalconf.stack.len);
274+
xcb_window_t wins[globalconf.stack.len];
275275

276276
foreach(client, globalconf.stack)
277277
wins[n++] = (*client)->window;
@@ -467,7 +467,7 @@ ewmh_process_client_message(xcb_client_message_event_t *ev)
467467
{
468468
lua_State *L = globalconf_get_lua_State();
469469
luaA_object_push(L, globalconf.tags.tab[idx]);
470-
lua_pushstring(L, "ewmh");
470+
lua_pushliteral(L, "ewmh");
471471
luaA_object_emit_signal(L, -2, "request::select", 1);
472472
lua_pop(L, 1);
473473
}
@@ -499,11 +499,11 @@ ewmh_process_client_message(xcb_client_message_event_t *ev)
499499
if((c = client_getbywin(ev->window))) {
500500
lua_State *L = globalconf_get_lua_State();
501501
luaA_object_push(L, c);
502-
lua_pushstring(L, "ewmh");
502+
lua_pushliteral(L, "ewmh");
503503

504504
/* Create table argument with raise=true. */
505505
lua_newtable(L);
506-
lua_pushstring(L, "raise");
506+
lua_pushliteral(L, "raise");
507507
lua_pushboolean(L, true);
508508
lua_settable(L, -3);
509509

@@ -768,10 +768,9 @@ static cairo_surface_array_t
768768
ewmh_window_icon_from_reply(xcb_get_property_reply_t *r)
769769
{
770770
uint32_t *data, *data_end;
771-
cairo_surface_array_t result;
771+
cairo_surface_array_t result = {};
772772
cairo_surface_t *s;
773773

774-
cairo_surface_array_init(&result);
775774
if(!r || r->type != XCB_ATOM_CARDINAL || r->format != 32)
776775
return result;
777776

0 commit comments

Comments
 (0)