+
Skip to content

FvwmRearrange: Use -on_screen to tile/cascade all windows on the monitor. #1170

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
Feb 14, 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
4 changes: 4 additions & 0 deletions doc/FvwmRearrange.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,10 @@ or cascaded.
-desk::
Causes all windows on the desk to be cascaded/tiled instead of only
windows that intersect the bounding box.
-on_screen::
Causes all windows on the monitor to be cascaded/tiled instead of only
windows that intersect the bounding box. Has no effect when used together
with _-desk_.

=== ORDERING OPTIONS

Expand Down
19 changes: 16 additions & 3 deletions modules/FvwmRearrange/FvwmRearrange.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ int transients = 0;
int maximized = 1;
int titled = 1;
int desk = 0;
int on_screen = 0;
int reversed = 0;
int do_ewmhiwa = 0;
int is_init = 1;
Expand Down Expand Up @@ -343,9 +344,19 @@ is_suitable_window(unsigned long *body)
int y = (int)cfgpacket->frame_y;
int w = (int)cfgpacket->frame_width;
int h = (int)cfgpacket->frame_height;
if (x >= box_x + box_w || x + w <= box_x
|| y >= box_y + box_h || y + h <= box_y)
return 0;
if (on_screen) {
int mon_x = mon->si->x;
int mon_y = mon->si->y;
int mon_w = mon->si->w;
int mon_h = mon->si->h;
if (x >= mon_x + mon_w || x + w <= mon_x
|| y >= mon_y + mon_h || y + h <= mon_y)
return 0;
} else {
if (x >= box_x + box_w || x + w <= box_x
|| y >= box_y + box_h || y + h <= box_y)
return 0;
}
}

if (!transients && IS_TRANSIENT(cfgpacket))
Expand Down Expand Up @@ -761,6 +772,8 @@ parse_args(int argc, char *argv[], int argi)
titled = 0;
} else if (StrEquals(argv[argi], "-desk")) {
desk = 1;
} else if (StrEquals(argv[argi], "-on_screen")) {
on_screen = 1;
} else if (StrEquals(argv[argi], "-ewmhiwa")) {
do_ewmhiwa = 1;

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