8000 Multiple FvwmPager Fixes by somiaj · Pull Request #999 · fvwmorg/fvwm3 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Multiple FvwmPager Fixes #999

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 6 commits into from
Apr 6, 2024
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
9 changes: 8 additions & 1 deletion doc/fvwm3_manpage_source.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3905,7 +3905,7 @@ Move shuffle Up Left
*Move* can be used to moved a window to a specified position:
+

> *Move* [screen _S_] \[w | m | v]_x_[p | w] \[w | m | v]_y_[p | w] [Warp] [ewmhiwa]
> *Move* [screen _S_] [desk _N_] \[w | m | v]_x_[p | w] \[w | m | v]_y_[p | w] [Warp] [ewmhiwa]

+
This will move the window to the _x_ and _y_ position (see below).
Expand All @@ -3920,6 +3920,13 @@ screen. The width and height of the screen are used for the
calculations instead of the display dimensions. The _screen_ is
interpreted as in the *MoveToScreen* command.
+
If the literal option _desk_ followed by a desk number _N_ is specified,
place the window on the specified desk after it has been moved. This can
serve two purposes, first you can move a window's position and desk in a
single command. Second when a window is moved between monitors, its desk
is updated to be the same as the new monitor. This option can override
that behavior by specifying which desk the window should end up on.
+
The positional arguments _x_ and _y_ can specify an absolute or relative
position from either the left/top or right/bottom of the screen. By default,
the numeric value given is interpreted as a percentage of the screen
Expand Down
1 change: 1 addition & 0 deletions fvwm/add_ 8000 window.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,6 +2435,7 @@ FvwmWindow *AddWindow(
setup_key_and_button_grabs(fw);

/****** inform modules of new window ******/
fw->UpdateDesk = -1; /* Initialize to ensure desk update. */
update_fvwm_monitor(fw);
BroadcastConfig(M_ADD_WINDOW,fw);
BroadcastWindowIconNames(fw, True, False);
Expand Down
2 changes: 2 additions & 0 deletions fvwm/fvwm.h
Original file line number Diff line number Diff line change
Expand Up @@ -831,6 +831,8 @@ typedef struct FvwmWindow
int FocusDesk;
/* Desk to deiconify to, for StubbornIcons */
int DeIconifyDesk;
/* If not negative, this is the desk update_fvwm_monitor will use. */
int UpdateDesk;

char *mini_pixmap_file;
FvwmPicture *mini_icon;
Expand Down
10 changes: 10 additions & 0 deletions fvwm/move_resize.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,16 @@ int GetMoveArguments(FvwmWindow *fw,
&scr_w, &scr_h);
action = GetNextToken(action, &s1);
}
if (s1 && StrEquals(s1, "desk"))
{
int desk;

free(s1);
token = PeekToken(action, &action);
if (sscanf(token, "%d", &desk) && desk >= 0)
fw->UpdateDesk = desk;
action = GetNextToken(action, &s1);
}
action = GetNextToken(action, &s2);
while (!global_flag_parsed)
{
Expand Down
40 changes: 36 additions & 4 deletions fvwm/update.c
Original file line number Diff line number Diff line change
Expand Up @@ -671,11 +671,43 @@ Bool update_fvwm_monitor(FvwmWindow *fw)
mnew = FindScreenOfXY(g.x, g.y);

/* Avoid unnecessary updates. */
if (mnew == fw->m)
if (mnew == fw->m && fw->UpdateDesk < 0)
return False;
fw->m_prev = fw->m;
fw->m = mnew;
fw->Desk = mnew->virtual_scr.CurrentDesk;

if (fw->UpdateDesk < 0) {
fw->Desk = mnew->virtual_scr.CurrentDesk;
goto out;
}

int old_desk, new_desk;
old_desk = new_desk = mnew->virtual_scr.CurrentDesk;
if (fw->m != mnew && fw->m != NULL)
old_desk = fw->m->virtual_scr.CurrentDesk;

/* Map/Unmap windows based on initial and final desk. */
if (fw->Desk == old_desk && fw->UpdateDesk != new_desk)
{
unmap_window(fw);
SET_FULLY_VISIBLE(fw, 0);
SET_PARTIALLY_VISIBLE(fw, 0);
}
else if (fw->Desk != old_desk && fw->UpdateDesk == new_desk)
{
/* If its an icon, auto-place it */
if (IS_ICONIFIED(fw))
{
AutoPlaceIcon(fw, NULL, True);
}
map_window(fw);
}
fw->Desk = fw->UpdateDesk;
fw->UpdateDesk = -1;

out:
if (fw->m != mnew) {
fw->m_prev = fw->m;
fw->m = mnew;
}
EWMH_SetCurrentDesktop(fw->m);
desk_add_fw(fw);
BroadcastConfig(M_CONFIGURE_WINDOW, fw);
Expand Down
4 changes: 2 additions & 2 deletions fvwm/virtual.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ static int GetDeskNumber(struct monitor *mon, char *action, int current_desk)
* Unmaps a window on transition to a new desktop
*
*/
static void unmap_window(FvwmWindow *t)
void unmap_window(FvwmWindow *t)
{
XWindowAttributes winattrs;
unsigned long eventMask = 0;
Expand Down Expand Up @@ -453,7 +453,7 @@ static void unmap_window(FvwmWindow *t)
* Maps a window on transition to a new desktop
*
*/
static void map_window(FvwmWindow *t)
void map_window(FvwmWindow *t)
{
XWindowAttributes winattrs;
unsigned long eventMask = 0;
Expand Down
2 changes: 2 additions & 0 deletions fvwm/virtual.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Bool is_pan_frame(Window w);
void MoveViewport(struct monitor *, int newx, int newy,Bool);
void goto_desk(int desk, struct monitor *);
void do_move_window_to_desk(FvwmWindow *fw, int desk);
void unmap_window(FvwmWindow *t);
void map_window(FvwmWindow *t);
Bool get_page_arguments(FvwmWindow *, char *action, int *page_x, int *page_y,
struct monitor **);
char *GetDesktopName(struct monitor *, int desk);
Expand Down
Loading
0