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
Fix scan_xrandr to fallback when a scan results in no new regions.
[spectrwm.git]
/
spectrwm.c
diff --git
a/spectrwm.c
b/spectrwm.c
index
071fb83
..
893d520
100644
(file)
--- a/
spectrwm.c
+++ b/
spectrwm.c
@@
-5563,7
+5563,7
@@
spawn_remove(struct spawn_prog *sp)
}
void
}
void
-spawn_replace(struct spawn_prog *sp, char *name, char *args)
+spawn_replace(struct spawn_prog *sp, const char *name, const char *args)
{
DNPRINTF(SWM_D_SPAWN, "spawn_replace: %s [%s]\n", sp->name, name);
{
DNPRINTF(SWM_D_SPAWN, "spawn_replace: %s [%s]\n", sp->name, name);
@@
-5574,7
+5574,7
@@
spawn_replace(struct spawn_prog *sp, char *name, char *args)
}
void
}
void
-setspawn(char *name, char *args)
+setspawn(const char *name, const char *args)
{
struct spawn_prog *sp;
{
struct spawn_prog *sp;
@@
-5706,7
+5706,7
@@
parsekeys(char *keystr, unsigned int currmod, unsigned int *mod, KeySym *ks)
}
char *
}
char *
-strdupsafe(char *str)
+strdupsafe(const char *str)
{
if (str == NULL)
return (NULL);
{
if (str == NULL)
return (NULL);
@@
-5715,7
+5715,8
@@
strdupsafe(char *str)
}
void
}
void
-key_insert(unsigned int mod, KeySym ks, enum keyfuncid kfid, char *spawn_name)
+key_insert(unsigned int mod, KeySym ks, enum keyfuncid kfid,
+ const char *spawn_name)
{
struct key *kp;
{
struct key *kp;
@@
-5759,7
+5760,7
@@
key_remove(struct key *kp)
void
key_replace(struct key *kp, unsigned int mod, KeySym ks, enum keyfuncid kfid,
void
key_replace(struct key *kp, unsigned int mod, KeySym ks, enum keyfuncid kfid,
- char *spawn_name)
+ const char *spawn_name)
{
DNPRINTF(SWM_D_KEY, "key_replace: %s [%s]\n", keyfuncs[kp->funcid].name,
spawn_name);
{
DNPRINTF(SWM_D_KEY, "key_replace: %s [%s]\n", keyfuncs[kp->funcid].name,
spawn_name);
@@
-5772,7
+5773,7
@@
key_replace(struct key *kp, unsigned int mod, KeySym ks, enum keyfuncid kfid,
void
setkeybinding(unsigned int mod, KeySym ks, enum keyfuncid kfid,
void
setkeybinding(unsigned int mod, KeySym ks, enum keyfuncid kfid,
- char *spawn_name)
+ const char *spawn_name)
{
struct key *kp;
{
struct key *kp;
@@
-8176,6
+8177,8
@@
scan_xrandr(int i)
xcb_randr_crtc_t *crtc;
xcb_screen_t *screen;
xcb_randr_crtc_t *crtc;
xcb_screen_t *screen;
+ DNPRINTF(SWM_D_MISC, "scan_xrandr: screen: %d\n", i);
+
if ((screen = get_screen(i)) == NULL)
errx(1, "ERROR: can't get screen %d.", i);
if ((screen = get_screen(i)) == NULL)
errx(1, "ERROR: can't get screen %d.", i);
@@
-8203,7
+8206,7
@@
scan_xrandr(int i)
new_region(&screens[i], 0, 0,
screen->width_in_pixels,
screen->height_in_pixels);
new_region(&screens[i], 0, 0,
screen->width_in_pixels,
screen->height_in_pixels);
- return;
+ goto out;
} else
ncrtc = srr->num_crtcs;
} else
ncrtc = srr->num_crtcs;
@@
-8229,12
+8232,16
@@
scan_xrandr(int i)
free(cir);
}
free(srr);
free(cir);
}
free(srr);
- } else
+ }
#endif /* SWM_XRR_HAS_CRTC */
#endif /* SWM_XRR_HAS_CRTC */
- {
+
+ /* If detection failed, create a single region that spans the screen. */
+ if (TAILQ_EMPTY(&screens[i].rl))
new_region(&screens[i], 0, 0, screen->width_in_pixels,
screen->height_in_pixels);
new_region(&screens[i], 0, 0, screen->width_in_pixels,
screen->height_in_pixels);
- }
+
+out:
+ DNPRINTF(SWM_D_MISC, "scan_xrandr: done.\n");
}
void
}
void