Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
spectrwm.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Only get xrandr extension data if xrandr is supported.
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
4ded077
..
ace7c52
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-701,8
+701,8
@@
char *
expand_tilde(char *s)
{
struct passwd *pwd;
expand_tilde(char *s)
{
struct passwd *pwd;
- int i;
- char user[LOGIN_NAME_MAX];
+ int i, max;
+ char *user;
const char *sc = s;
char *result;
const char *sc = s;
char *result;
@@
-715,6
+715,13
@@
expand_tilde(char *s)
}
++s;
}
++s;
+
+ if ((max = sysconf(_SC_LOGIN_NAME_MAX)) == -1)
+ errx(1, "expand_tilde: sysconf");
+
+ if ((user = calloc(1, max + 1)) == NULL)
+ errx(1, "expand_tilde: calloc");
+
for (i = 0; s[i] != '/' && s[i] != '\0'; ++i)
user[i] = s[i];
user[i] = '\0';
for (i = 0; s[i] != '/' && s[i] != '\0'; ++i)
user[i] = s[i];
user[i] = '\0';
@@
-7688,12
+7695,15
@@
setup_screens(void)
c = xcb_randr_query_version(conn, 1, 1);
r = xcb_randr_query_version_reply(conn, c, NULL);
if (r) {
c = xcb_randr_query_version(conn, 1, 1);
r = xcb_randr_query_version_reply(conn, c, NULL);
if (r) {
- if (r->major_version >= 1)
- xrandr_support = 1;
+ if (r->major_version >= 1) {
+ qep = xcb_get_extension_data(conn, &xcb_randr_id);
+ if (qep) {
+ xrandr_support = 1;
+ xrandr_eventbase = qep->first_event;
+ }
+ }
free(r);
}
free(r);
}
- qep = xcb_get_extension_data(conn, &xcb_randr_id);
- xrandr_eventbase = qep->first_event;
cursor_font = xcb_generate_id(conn);
xcb_open_font(conn, cursor_font, strlen("cursor"), "cursor");
cursor_font = xcb_generate_id(conn);
xcb_open_font(conn, cursor_font, strlen("cursor"), "cursor");