mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-19 12:28:22 +01:00
wmaker: Print error dialog when attempting to delete an in-use workspace.
This commit is contained in:
committed by
Carlos R. Mafra
parent
88393f4a6c
commit
15ae70b159
@@ -50,6 +50,7 @@
|
|||||||
#include "xinerama.h"
|
#include "xinerama.h"
|
||||||
#include "event.h"
|
#include "event.h"
|
||||||
#include "wsmap.h"
|
#include "wsmap.h"
|
||||||
|
#include "dialog.h"
|
||||||
|
|
||||||
#define MC_NEW 0
|
#define MC_NEW 0
|
||||||
#define MC_DESTROY_LAST 1
|
#define MC_DESTROY_LAST 1
|
||||||
@@ -142,8 +143,13 @@ Bool wWorkspaceDelete(WScreen * scr, int workspace)
|
|||||||
/* verify if workspace is in use by some window */
|
/* verify if workspace is in use by some window */
|
||||||
tmp = scr->focused_window;
|
tmp = scr->focused_window;
|
||||||
while (tmp) {
|
while (tmp) {
|
||||||
if (!IS_OMNIPRESENT(tmp) && tmp->frame->workspace == workspace)
|
if (!IS_OMNIPRESENT(tmp) && tmp->frame->workspace == workspace) {
|
||||||
|
char buf[256];
|
||||||
|
snprintf(buf, sizeof(buf), _("Workspace \"%s\" in use; cannot delete"),
|
||||||
|
scr->workspaces[workspace]->name);
|
||||||
|
wMessageDialog(scr, _("Error"), buf, _("OK"), NULL, NULL);
|
||||||
return False;
|
return False;
|
||||||
|
}
|
||||||
tmp = tmp->prev;
|
tmp = tmp->prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user