ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/rxvt-unicode/src/main.C
(Generate patch)

Comparing rxvt-unicode/src/main.C (file contents):
Revision 1.398 by sf-exg, Tue Sep 8 07:54:58 2015 UTC vs.
Revision 1.400 by sf-exg, Tue Jun 28 21:56:17 2016 UTC

12 * - extensive modifications 12 * - extensive modifications
13 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de> 13 * Copyright (c) 1997,1998 Oezguer Kesim <kesim@math.fu-berlin.de>
14 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com> 14 * Copyright (c) 1998-2001 Geoff Wing <gcw@pobox.com>
15 * - extensive modifications 15 * - extensive modifications
16 * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de> 16 * Copyright (c) 2003-2014 Marc Lehmann <schmorp@schmorp.de>
17 * Copyright (c) 2015 Emanuele Giaquinta <e.giaquinta@glauco.it>
17 * 18 *
18 * This program is free software; you can redistribute it and/or modify 19 * This program is free software; you can redistribute it and/or modify
19 * it under the terms of the GNU General Public License as published by 20 * it under the terms of the GNU General Public License as published by
20 * the Free Software Foundation; either version 3 of the License, or 21 * the Free Software Foundation; either version 3 of the License, or
21 * (at your option) any later version. 22 * (at your option) any later version.
1051{ 1052{
1052 pix_colors[dst].free (this); 1053 pix_colors[dst].free (this);
1053 pix_colors[dst].set (this, rs[Rs_color + dst] = rs[Rs_color + src]); 1054 pix_colors[dst].set (this, rs[Rs_color + dst] = rs[Rs_color + src]);
1054} 1055}
1055 1056
1057#ifdef SMART_RESIZE
1058static unsigned int
1059get_parent_bw (Display *dpy, Window w)
1060{
1061 int idummy;
1062 unsigned int udummy;
1063 Window wdummy, parent;
1064 Window *children;
1065 unsigned int nchildren, border_width;
1066
1067 XQueryTree (dpy, w, &wdummy, &parent, &children, &nchildren);
1068 XFree (children);
1069 XGetGeometry (dpy, parent, &wdummy, &idummy, &idummy,
1070 &udummy, &udummy, &border_width, &udummy);
1071
1072 return border_width;
1073}
1074#endif
1075
1056/* -------------------------------------------------------------------- * 1076/* -------------------------------------------------------------------- *
1057 * - WINDOW RESIZING - * 1077 * - WINDOW RESIZING - *
1058 * -------------------------------------------------------------------- */ 1078 * -------------------------------------------------------------------- */
1059void 1079void
1060rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent) 1080rxvt_term::resize_all_windows (unsigned int newwidth, unsigned int newheight, int ignoreparent)
1095 * if display->root isn't the parent window, a WM will probably have offset 1115 * if display->root isn't the parent window, a WM will probably have offset
1096 * our position for handles and decorations. Counter it 1116 * our position for handles and decorations. Counter it
1097 */ 1117 */
1098 if (x1 != x || y1 != y) 1118 if (x1 != x || y1 != y)
1099 { 1119 {
1100 x -= x1; 1120 unsigned int border_width = get_parent_bw (dpy, parent);
1101 y -= y1; 1121
1122 x -= x1 + border_width;
1123 y -= y1 + border_width;
1102 } 1124 }
1103 1125
1104 x1 = (DisplayWidth (dpy, display->screen) - old_width ) / 2; 1126 x1 = (DisplayWidth (dpy, display->screen) - old_width ) / 2;
1105 y1 = (DisplayHeight (dpy, display->screen) - old_height) / 2; 1127 y1 = (DisplayHeight (dpy, display->screen) - old_height) / 2;
1106 dx = old_width - szHint.width; 1128 dx = old_width - szHint.width;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines