+
Skip to content

FvwmPager make mini windows always round down. #756

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
Nov 10, 2022
Merged
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
52 changes: 4 additions & 48 deletions modules/FvwmPager/x_pager.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,6 @@ Window icon_win; /* icon window */

static int MyVx, MyVy; /* copy of Scr.Vx/y for drag logic */

static void adjust_for_sizehints(int, int);
static rectangle CalcGeom(PagerWindow *, bool);
static rectangle set_vp_size_and_loc(void);
static void fvwmrec_to_pager(rectangle *, bool);
Expand Down Expand Up @@ -441,31 +440,6 @@ void initialize_balloon_window(void)
return;
}

/* XXX: Here be dragons! Ideally, this function should be parameterised,
* however due to all the global state in FvwmPager, there's no point. This
* should get added to a clean up TODO at some point.
*/
static void
adjust_for_sizehints(int VxPages, int VyPages)
{
int w_mult;
int h_mult;

w_mult = Columns * VxPages;
h_mult = Rows * VyPages;

/* Adjust window size to be even multiples of increment size. */
if (pwindow.width > 0) {
pwindow.width = (pwindow.width / w_mult + 1) * w_mult;
}
if (pwindow.height > 0) {
pwindow.height = (pwindow.height / h_mult + 1) * h_mult;
}

desk_w = (pwindow.width - Columns + 1) / Columns;
desk_h = (pwindow.height - Rows * label_h - Rows + 1) / Rows;
}

/* Computes pager size rectangle from fvwm size or visa versa */
static void
fvwmrec_to_pager(rectangle *rec, bool is_icon)
Expand Down Expand Up @@ -702,10 +676,8 @@ void initialize_pager(void)
label_h * Rows + Rows;
}
}
/* Adjust the window to handle these new sizehints. This is also called
* from ReConfigure().
*/
adjust_for_sizehints(VxPages, VyPages);
desk_w = (pwindow.width - Columns + 1) / Columns;
desk_h = (pwindow.height - Rows * label_h - Rows + 1) / Rows;

if (is_transient)
{
Expand Down Expand Up @@ -1427,25 +1399,16 @@ void ReConfigure(void)
unsigned border_width, depth;
rectangle vp = {0, 0, 0, 0};
int i = 0, j = 0, k = 0;
int old_ww;
int old_wh;
int is_size_changed;
struct fpmonitor *mon = fpmonitor_this();
int VxPages = mon->virtual_scr.VxPages, VyPages = mon->virtual_scr.VyPages;

old_ww = pwindow.width;
old_wh = pwindow.height;
if (!XGetGeometry(dpy, Scr.Pager_w, &root, &vp.x, &vp.y, (unsigned *)&pwindow.width,
(unsigned *)&pwindow.height, &border_width,&depth))
{
return;
}
is_size_changed = (old_ww != pwindow.width || old_wh != pwindow.height);

adjust_for_sizehints(VxPages, VyPages);

XSetWMNormalHints(dpy,Scr.Pager_w,&sizehints);

desk_w = (pwindow.width - Columns + 1) / Columns;
desk_h = (pwindow.height - Rows * label_h - Rows + 1) / Rows;
vp = set_vp_size_and_loc();

for(k=0;k<Rows;k++)
Expand All @@ -1460,13 +1423,6 @@ void ReConfigure(void)
desk_w,desk_h+label_h);
XMoveResizeWindow(
dpy,Desks[i].w, -1, (LabelsBelow) ? -1 : label_h - 1, desk_w,desk_h);
if (!is_size_changed)
{
if (CSET_IS_TRANSPARENT(Desks[i].colorset))
{
draw_desk_background(i, vp.width, vp.height);
}
}
if (HilightDesks)
{
if(i == mon->virtual_scr.CurrentDesk - desk1)
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载