diff options
author | Vito Caputo <vcaputo@pengaru.com> | 2020-12-23 18:24:23 -0800 |
---|---|---|
committer | Vito Caputo <vcaputo@pengaru.com> | 2020-12-23 18:25:55 -0800 |
commit | d564d06b1ce89e90e1aacc5433b5eabd38270973 (patch) | |
tree | 18cac48f7687c9cbacf343baa6c9c047c81befd7 | |
parent | 3161db573424a554b536aaa492397341b84683ce (diff) |
desktop: drop unused desktop names
At some point I wanted to support naming virtual desktops, but that
never materialized and I don't find myself wishing it was there.
-rw-r--r-- | src/desktop.c | 4 | ||||
-rw-r--r-- | src/desktop.h | 3 | ||||
-rw-r--r-- | src/key.c | 4 | ||||
-rw-r--r-- | src/vwm.c | 2 | ||||
-rw-r--r-- | src/window.c | 2 |
5 files changed, 6 insertions, 9 deletions
diff --git a/src/desktop.c b/src/desktop.c index e6130e0..6038383 100644 --- a/src/desktop.c +++ b/src/desktop.c @@ -138,7 +138,7 @@ vwm_desktop_t * vwm_desktop_next(vwm_t *vwm, vwm_desktop_t *desktop, vwm_directi } /* create a virtual desktop */ -vwm_desktop_t * vwm_desktop_create(vwm_t *vwm, char *name) +vwm_desktop_t * vwm_desktop_create(vwm_t *vwm) { vwm_desktop_t *desktop; @@ -148,8 +148,6 @@ vwm_desktop_t * vwm_desktop_create(vwm_t *vwm, char *name) goto _fail; } - desktop->name = name == NULL ? name : strdup(name); - list_add_tail(&desktop->desktops, &vwm->desktops); list_add_tail(&desktop->desktops_mru, &vwm->desktops_mru); diff --git a/src/desktop.h b/src/desktop.h index c231ca5..5c83a4c 100644 --- a/src/desktop.h +++ b/src/desktop.h @@ -11,13 +11,12 @@ typedef struct _vwm_window_t vwm_window_t; typedef struct _vwm_desktop_t { list_head_t desktops; /* global list of (virtual) desktops */ list_head_t desktops_mru; /* global list of (virtual) desktops in MRU order */ - char *name; /* name of the desktop (TODO) */ vwm_window_t *focused_window; /* the focused window on this virtual desktop */ } vwm_desktop_t; void vwm_desktop_mru(vwm_t *vwm, vwm_desktop_t *desktop); int vwm_desktop_focus(vwm_t *vwm, vwm_desktop_t *desktop); -vwm_desktop_t * vwm_desktop_create(vwm_t *vwm, char *name); +vwm_desktop_t * vwm_desktop_create(vwm_t *vwm); void vwm_desktop_destroy(vwm_t *vwm, vwm_desktop_t *desktop); vwm_desktop_t * vwm_desktop_next_mru(vwm_t *vwm, vwm_desktop_t *desktop, vwm_direction_t direction); vwm_desktop_t * vwm_desktop_next(vwm_t *vwm, vwm_desktop_t *desktop, vwm_direction_t direction); @@ -204,10 +204,10 @@ void vwm_key_pressed(vwm_t *vwm, Window win, XKeyPressedEvent *keypress) if (keypress->state & ShiftMask) { if (vwin) { /* migrate the focused window to a newly created virtual desktop, focusing the new desktop simultaneously */ - vwm_win_migrate(vwm, vwin, vwm_desktop_create(vwm, NULL)); + vwm_win_migrate(vwm, vwin, vwm_desktop_create(vwm)); } } else { - vwm_desktop_focus(vwm, vwm_desktop_create(vwm, NULL)); + vwm_desktop_focus(vwm, vwm_desktop_create(vwm)); vwm_desktop_mru(vwm, vwm->focused_desktop); } break; @@ -134,7 +134,7 @@ static vwm_t * vwm_startup(void) XSetInputFocus(VWM_XDISPLAY(vwm), VWM_XROOT(vwm), RevertToPointerRoot, CurrentTime); /* create initial virtual desktop */ - vwm_desktop_focus(vwm, vwm_desktop_create(vwm, NULL)); + vwm_desktop_focus(vwm, vwm_desktop_create(vwm)); vwm_desktop_mru(vwm, vwm->focused_desktop); /* manage all preexisting windows */ diff --git a/src/window.c b/src/window.c index cfcdd36..b3e32c1 100644 --- a/src/window.c +++ b/src/window.c @@ -572,7 +572,7 @@ vwm_window_t * vwm_win_manage_xwin(vwm_t *vwm, vwm_xwindow_t *xwin) /* if the desktop has no focused window yet, automatically focus the newly managed one, provided we're on the desktop context */ if (!vwm->focused_desktop->focused_window && vwm->focused_context == VWM_CONTEXT_DESKTOP) { - VWM_TRACE("Mapped new window \"%s\" is alone on desktop \"%s\", focusing", xwin->name, vwm->focused_desktop->name); + VWM_TRACE("Mapped new window \"%s\" is alone on desktop, focusing", xwin->name); vwm_win_focus(vwm, vwin); } |