+
Skip to content

expand: introduce $[desk.count] #1158

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 11, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions doc/fvwm3_manpage_source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,9 @@ $[wa.x] $[wa.y] $[wa.width] $[wa.height]::
$[dwa.x] $[dwa.y] $[dwa.width] $[dwa.height]::
Either coordinate or the width or height of the dynamic EWMH working area.

$[desk.count]::
The number of desktops defined with the *DesktopName* command.

$[desk.n]::
The current desk number.

Expand Down
6 changes: 6 additions & 0 deletions fvwm/expand.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ static char *function_vars[] =
"cw.x",
"cw.y",
"debuglog.state",
"desk.count",
"desk.height",
"desk.n",
"desk.pagesx",
Expand Down Expand Up @@ -177,6 +178,7 @@ enum
VAR_CW_X,
VAR_CW_Y,
VAR_DEBUG_LOG_STATE,
VAR_DESK_COUNT,
VAR_DESK_HEIGHT,
VAR_DESK_N,
VAR_DESK_PAGESX,
Expand Down Expand Up @@ -730,6 +732,10 @@ static signed int expand_vars_extended(
/* only exact matches for all other variables */
switch ((i = GetTokenIndex(var_name, function_vars, 0, &rest)))
{
case VAR_DESK_COUNT:
is_numeric = True;
val = number_of_desktops(m);
break;
case VAR_DESK_N:
is_numeric = True;
val = m->virtual_scr.CurrentDesk;
Expand Down
3 changes: 1 addition & 2 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
* 2 is the default.
*/
static void store_desktop_cmd(int, char *);
static int number_of_desktops(struct monitor *);
static void init_one_panframe(PanFrame *, int, int, int, int, int);
static void parse_edge_leave_command(char *, int);
static void broadcast_new_desk_monitor(struct monitor *);
Expand Down Expand Up @@ -2800,7 +2799,7 @@ void CMD_Scroll(F_CMD_ARGS)
return;
}

static int
int
number_of_desktops(struct monitor *m)
{
DesktopsInfo *d;
Expand Down
1 change: 1 addition & 0 deletions fvwm/virtual.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ void map_window(FvwmWindow *t);
Bool get_page_arguments(char *action, int *page_x, int *page_y,
struct monitor **);
char *GetDesktopName(struct monitor *, int desk);
int number_of_desktops(struct monitor *);

struct desktop_cmd {
int desk;
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载