Remove title squeeze and window highlight options.

1. Always squeeze title and on left.
2. Always highlight windows and their titles.
This commit is contained in:
Mike Small 2018-08-14 00:38:38 -04:00
parent c042bc37ee
commit 94f29d39ab
12 changed files with 589 additions and 1076 deletions

View File

@ -243,14 +243,13 @@ different types of windows. For example:
The default is "black".
.IP "\fBBorderTileBackground\fP \fIstring\fP [{ \fIwincolorlist\fP }]" 8
This variable specifies the default background color in the gray pattern
used in unhighlighted borders (only if \fBNoHighlight\fP hasn't been set),
used in unhighlighted borders,
and may only be given within a \fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The
optional \fIwincolorlist\fP allows per-window colors to be specified.
The default is "white".
.IP "\fBBorderTileForeground\fP \fIstring\fP [{ \fIwincolorlist\fP }]" 8
This variable specifies the default foreground color in the gray pattern
used in unhighlighted borders (only
if \fBNoHighlight\fP hasn't been set), and may only be given within a
used in unhighlighted borders, and may only be given within a
\fBColor\fP, \fBGrayscale\fP or \fBMonochrome\fP list. The optional \fIwincolorlist\fP allows
per-window colors to be specified. The default is "black".
.IP "\fBBorderWidth\fP \fIpixels\fP" 8
@ -364,11 +363,6 @@ information windows. The default is "black".
.IP "\fBDontMoveOff\fP" 8
This variable indicates that windows should not be allowed to be moved off the
screen. It can be overridden by the \fBf.forcemove\fP function.
.IP "\fBDontSqueezeTitle\fP [{ \fIwin-list\fP }] " 8
This variable indicates that titlebars should not be squeezed to their
minimum size as described under \fBSqueezeTitle\fP below.
If the optional window list is supplied, only those windows will be
prevented from being squeezed.
.IP "\fBForceIcons\fP" 8
This variable indicates that icon pixmaps specified in the \fBIcons\fP
variable should override any client-supplied pixmaps.
@ -515,14 +509,6 @@ file contains a completely new set of bindings and definitions.
.IP "\fBNoGrabServer\fP" 8
This variable indicates that \fItwmruined\fP should not grab the server
when popping up menus and moving opaque windows.
.IP "\fBNoHighlight\fP [{ \fIwin-list\fP }]" 8
This variable indicates that borders should not be highlighted to track the
location of the pointer. If the optional \fIwin-list\fP is given, highlighting
will only be disabled for those windows.
When the border is highlighted, it will
be drawn in the current \fBBorderColor\fP. When the border is not
highlighted, it will be stippled with a gray pattern using the
current \fBBorderTileForeground\fP and \fBBorderTileBackground\fP colors.
.IP "\fBNoMenuShadows\fP" 8
This variable indicates that menus should not have drop shadows drawn behind
them. This is typically used with slower servers since it speeds up menu
@ -564,30 +550,11 @@ the pointer is moved quickly and \fItwmruined\fP is slow to respond, input can b
directed to the old window instead of the new. This option is typically
used to prevent this ``input lag'' and to
work around bugs in older applications that have problems with focus events.
.IP "\fBNoTitleHighlight\fP [{ \fIwin-list\fP }]" 8
This variable indicates that the highlight area of the titlebar, which is
used to indicate the window that currently has the input focus, should not
be displayed. If the optional \fIwin-list\fP is given, only those windows
will not have highlight areas. This and the \fBSqueezeTitle\fP options
can be set to substantially reduce the amount of screen space required by
titlebars.
.IP "\fBOpaqueMove\fP" 8
This variable indicates that the \fBf.move\fP function should actually move
the window instead of just an outline so that the user can immediately see
what the window will look like in the new position. This option is typically
used on fast displays (particularly if \fBNoGrabServer\fP is set).
.IP "\fBPixmaps\fP { \fIpixmaps\fP }" 8
This variable specifies a list of pixmaps that define the appearance of various
images. Each entry is a keyword indicating the pixmap to set, followed by a
string giving the name of the bitmap file. The following pixmaps
may be specified:
.EX 0
\fBPixmaps\fP
{
TitleHighlight "gray1"
}
.EE
The default for \fITitleHighlight\fP is to use an even stipple pattern.
.IP "\fBPriority\fP \fIpriority\fP" 8
This variable sets \fItwmruined\fP's priority. \fIpriority\fP should be an
unquoted, signed number (e.g. 999). This variable has an effect only
@ -627,36 +594,6 @@ For example:
.EE
This would place on the root window 3 pixel values for borders and titlebars,
as well as the three color strings, all taken from the default colormap.
.IP "\fBSqueezeTitle\fP [{ \fIsqueeze-list\fP }] " 8
This variable indicates that \fItwmruined\fP should attempt to use the SHAPE
extension to make titlebars occupy only as much screen space as they need,
rather than extending all the way across the top of the window.
The optional \fIsqueeze-list\fP
may be used to control the location of the squeezed titlebar along the
top of the window. It contains entries of the form:
.EX 0
"\fIname\fP" \fIjustification\fP \fInum\fP \fIdenom\fP
.EE
where \fIname\fP is a window name, \fIjustification\fP is either \fBleft\fP,
\fBcenter\fP, or \fBright\fP, and \fInum\fP and \fIdenom\fP
are numbers specifying a ratio giving the relative position about which
the titlebar is justified. The ratio is measured from left to right if
the numerator is positive, and right to left if negative. A denominator
of 0 indicates that the numerator should be measured in pixels. For
convenience, the ratio 0/0 is the same as 1/2 for \fBcenter\fP and -1/1
for \fBright\fP. For example:
.EX 0
\fBSqueezeTitle\fP
{
"XTerm" left 0 0
"xterm1" left 1 3
"xterm2" left 2 3
"oclock" center 0 0
"emacs" right 0 0
}
.EE
The \fBDontSqueezeTitle\fP list can be used to turn off squeezing on
certain titles.
.IP "\fBStartIconified\fP [{ \fIwin-list\fP }] " 8
This variable indicates that client windows should initially be left as
icons until explicitly deiconified by the user. If the optional \fIwin-list\fP
@ -847,9 +784,6 @@ the \fBSelect\fP cursor and the next window to receive a button press will
be chosen:
.IP "\fB!\fP \fIstring\fP" 8
This is an abbreviation for \fBf.exec\fP \fIstring\fP.
.\"OBSOLETE - use a clipboard client
.\".IP "\fB^\fP \fIstring\fP" 8
.\"This is an abbreviation for \fBf.cut\fP \fIstring\fP.
.IP "\fBf.autoraise\fP" 8
This function toggles whether or not the selected window is raised whenever
entered by the pointer. See the description of the variable \fBAutoRaise\fP.
@ -872,13 +806,6 @@ A pointer driven keyboard focus will install a private colormap upon entry
of the window owning the colormap. Using the click to type model, private
colormaps will not be installed until the user presses a mouse button on
the target window.
.\"OBSOLETE - should go away and use a clipboard.
.\".IP "\fBf.cut\fP \fIstring\fP" 8
.\"This function places the specified \fIstring\fP (followed by a newline
.\"character) into the root window property CUT_BUFFER0.
.\".IP "\fBf.cutfile\fP" 8
.\"This function reads the file indicated by the contents of the CUT_BUFFER0
.\"window property and replaces the cut buffer.
.IP "\fBf.deiconify\fP" 8
This function deiconifies the selected window. If the window is not an icon,
this function does nothing.

View File

@ -272,18 +272,10 @@ AddWindow(Window w)
tmp_win->full_name = strdup(tmp_win->name);
namelen = strlen (tmp_win->name);
tmp_win->highlight = Scr->Highlight &&
(!(short)(long) LookInList(Scr->NoHighlight, tmp_win->full_name,
&tmp_win->class));
tmp_win->stackmode = Scr->StackMode &&
(!(short)(long) LookInList(Scr->NoStackModeL, tmp_win->full_name,
&tmp_win->class));
tmp_win->titlehighlight = Scr->TitleHighlight &&
(!(short)(long) LookInList(Scr->NoTitleHighlight, tmp_win->full_name,
&tmp_win->class));
tmp_win->auto_raise = (short)(long) LookInList(Scr->AutoRaise,
tmp_win->full_name,
&tmp_win->class);
@ -303,25 +295,7 @@ AddWindow(Window w)
tmp_win->ring.next = tmp_win->ring.prev = NULL;
tmp_win->ring.cursor_valid = False;
tmp_win->squeeze_info = NULL;
/*
* get the squeeze information; note that this does not have to be freed
* since it is coming from the screen list
*/
if (HasShape) {
if (!LookInList (Scr->DontSqueezeTitleL, tmp_win->full_name,
&tmp_win->class)) {
tmp_win->squeeze_info = (SqueezeInfo *)
LookInList (Scr->SqueezeTitleL, tmp_win->full_name,
&tmp_win->class);
if (!tmp_win->squeeze_info) {
static SqueezeInfo default_squeeze = { J_LEFT, 0, 0 };
if (Scr->SqueezeTitle)
tmp_win->squeeze_info = &default_squeeze;
}
}
}
tmp_win->squeeze = HasShape;
tmp_win->old_bw = tmp_win->attr.border_width;
if (Scr->ClientBorderWidth) {
@ -820,25 +794,20 @@ AddWindow(Window w)
}
else {
tmp_win->title_w = 0;
tmp_win->squeeze_info = NULL;
tmp_win->squeeze = False;
}
if (tmp_win->highlight)
{
tmp_win->gray = XCreatePixmapFromBitmapData(dpy, Scr->Root,
tmp_win->gray = XCreatePixmapFromBitmapData(dpy, Scr->Root,
gray_bits, gray_width, gray_height,
tmp_win->border_tile.fore, tmp_win->border_tile.back,
Scr->d_depth);
SetBorder (tmp_win, False);
}
else
tmp_win->gray = None;
SetBorder (tmp_win, False);
if (tmp_win->title_w) {
CreateWindowTitlebarButtons (tmp_win);
ComputeTitleLocation (tmp_win);
ComputeTitleLocation(tmp_win);
XMoveWindow (dpy, tmp_win->title_w,
tmp_win->title_x, tmp_win->title_y);
XDefineCursor(dpy, tmp_win->title_w, Scr->TitleCursor);
@ -863,10 +832,10 @@ AddWindow(Window w)
unsigned wws, hws, wbs, hbs;
int boundingShaped, clipShaped;
XShapeSelectInput (dpy, tmp_win->w, ShapeNotifyMask);
XShapeQueryExtents (dpy, tmp_win->w,
&boundingShaped, &xws, &yws, &wws, &hws,
&clipShaped, &xbs, &ybs, &wbs, &hbs);
XShapeSelectInput(dpy, tmp_win->w, ShapeNotifyMask);
XShapeQueryExtents(dpy, tmp_win->w,
&boundingShaped, &xws, &yws, &wws, &hws,
&clipShaped, &xbs, &ybs, &wbs, &hbs);
tmp_win->wShaped = boundingShaped;
}
@ -1059,68 +1028,23 @@ GrabKeys(TwmWindow *tmp_win)
static Window CreateHighlightWindow (TwmWindow *tmp_win)
{
XSetWindowAttributes attributes; /* attributes for create windows */
Pixmap pm = None;
GC gc;
XGCValues gcv;
unsigned long valuemask;
XSetWindowAttributes attributes;
int h = (Scr->TitleHeight - 2 * Scr->FramePadding);
Window w;
/*
* If a special highlight pixmap was given, use that. Otherwise,
* use a nice, even gray pattern. The old horizontal lines look really
* awful on interlaced monitors (as well as resembling other looks a
* little bit too closely), but can be used by putting
*
* Pixmaps { TitleHighlight "hline2" }
*
* (or whatever the horizontal line bitmap is named) in the startup
* file. If all else fails, use the foreground color to look like a
* solid line.
*/
if (!Scr->hilitePm) {
Scr->hilitePm = XCreateBitmapFromData (dpy, tmp_win->title_w,
gray_bits, gray_width,
gray_height);
Scr->hilite_pm_width = gray_width;
Scr->hilite_pm_height = gray_height;
}
if (Scr->hilitePm) {
pm = XCreatePixmap (dpy, tmp_win->title_w,
Scr->hilite_pm_width, Scr->hilite_pm_height,
Scr->d_depth);
gcv.foreground = tmp_win->title.fore;
gcv.background = tmp_win->title.back;
gcv.graphics_exposures = False;
gc = XCreateGC (dpy, pm,
(GCForeground|GCBackground|GCGraphicsExposures),
&gcv);
if (gc) {
XCopyPlane (dpy, Scr->hilitePm, pm, gc, 0, 0,
Scr->hilite_pm_width, Scr->hilite_pm_height,
0, 0, 1);
XFreeGC (dpy, gc);
} else {
XFreePixmap (dpy, pm);
pm = None;
}
}
if (pm) {
valuemask = CWBackPixmap;
attributes.background_pixmap = pm;
} else {
valuemask = CWBackPixel;
attributes.background_pixel = tmp_win->title.fore;
}
/* Use an even gray pattern. */
Scr->hilitePm = XCreateBitmapFromData (dpy, tmp_win->title_w,
gray_bits, gray_width,
gray_height);
Scr->hilite_pm_width = gray_width;
Scr->hilite_pm_height = gray_height;
attributes.background_pixel = tmp_win->title.fore;
w = XCreateWindow (dpy, tmp_win->title_w, 0, Scr->FramePadding,
(unsigned int) Scr->TBInfo.width, (unsigned int) h,
(unsigned int) 0,
Scr->d_depth, (unsigned int) CopyFromParent,
Scr->d_visual, valuemask, &attributes);
if (pm) XFreePixmap (dpy, pm);
Scr->d_visual, CWBackPixel, &attributes);
return w;
}
@ -1139,7 +1063,6 @@ void ComputeCommonTitleOffsets (void)
Scr->TBInfo.rightoff += (Scr->ButtonIndent +
((Scr->TBInfo.nright * buttonwidth) -
Scr->TBInfo.pad));
return;
}
void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze)
@ -1148,15 +1071,15 @@ void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze)
if (tmp_win->hilite_w || Scr->TBInfo.nright > 0)
tmp_win->highlightx += Scr->TitlePadding;
tmp_win->rightx = width - Scr->TBInfo.rightoff;
if (squeeze && tmp_win->squeeze_info) {
if (squeeze && tmp_win->squeeze) {
int rx = (tmp_win->highlightx +
(tmp_win->hilite_w
? Scr->TBInfo.width * 2 : 0) +
(Scr->TBInfo.nright > 0 ? Scr->TitlePadding : 0) +
Scr->FramePadding);
if (rx < tmp_win->rightx) tmp_win->rightx = rx;
if (rx < tmp_win->rightx)
tmp_win->rightx = rx;
}
return;
}
@ -1165,57 +1088,14 @@ void ComputeWindowTitleOffsets (TwmWindow *tmp_win, int width, Bool squeeze)
* into account since we want (0,0) of the title window to line up with (0,0)
* of the frame window.
*/
void ComputeTitleLocation (register TwmWindow *tmp)
void ComputeTitleLocation(TwmWindow *tmp)
{
tmp->title_x = -tmp->frame_bw;
tmp->title_y = -tmp->frame_bw;
if (tmp->squeeze_info) {
register SqueezeInfo *si = tmp->squeeze_info;
int basex;
int maxwidth = tmp->frame_width;
int tw = tmp->title_width;
/*
* figure label base from squeeze info (justification fraction)
*/
if (si->denom == 0) { /* num is pixel based */
if ((basex = si->num) == 0) { /* look for special cases */
switch (si->justify) {
case J_RIGHT:
basex = maxwidth;
break;
case J_CENTER:
basex = maxwidth / 2;
break;
}
}
} else { /* num/denom is fraction */
basex = ((si->num * maxwidth) / si->denom);
if (si->num < 0) basex += maxwidth;
}
/*
* adjust for left (nop), center, right justify and clip
*/
switch (si->justify) {
case J_CENTER:
basex -= tw / 2;
break;
case J_RIGHT:
basex -= tw - 1;
break;
}
if (basex > maxwidth - tw + 1)
basex = maxwidth - tw + 1;
if (basex < 0) basex = 0;
tmp->title_x = basex - tmp->frame_bw;
}
}
static void CreateWindowTitlebarButtons (TwmWindow *tmp_win)
static void CreateWindowTitlebarButtons(TwmWindow *tmp_win)
{
unsigned long valuemask; /* mask for create windows */
XSetWindowAttributes attributes; /* attributes for create windows */
@ -1282,13 +1162,11 @@ static void CreateWindowTitlebarButtons (TwmWindow *tmp_win)
}
}
tmp_win->hilite_w = (tmp_win->titlehighlight
? CreateHighlightWindow (tmp_win) : None);
tmp_win->hilite_w = CreateHighlightWindow(tmp_win);
XMapSubwindows(dpy, tmp_win->title_w);
if (tmp_win->hilite_w)
XUnmapWindow(dpy, tmp_win->hilite_w);
return;
}

1151
src/gram.c

File diff suppressed because it is too large Load Diff

View File

@ -11,58 +11,52 @@
#define ALL 267
#define OR 268
#define CURSORS 269
#define PIXMAPS 270
#define ICONS 271
#define COLOR 272
#define SAVECOLOR 273
#define MONOCHROME 274
#define FUNCTION 275
#define WINDOW_FUNCTION 276
#define ZOOM 277
#define MAKE_TITLE 278
#define GRAYSCALE 279
#define NO_TITLE 280
#define AUTO_RAISE 281
#define NO_HILITE 282
#define ICON_REGION 283
#define META 284
#define SHIFT 285
#define LOCK 286
#define CONTROL 287
#define WINDOW 288
#define TITLE 289
#define ICON 290
#define ROOT 291
#define FRAME 292
#define COLON 293
#define EQUALS 294
#define SQUEEZE_TITLE 295
#define DONT_SQUEEZE_TITLE 296
#define START_ICONIFIED 297
#define NO_TITLE_HILITE 298
#define TITLE_HILITE 299
#define MOVE 300
#define RESIZE 301
#define WAIT 302
#define SELECT 303
#define KILL 304
#define LEFT_TITLEBUTTON 305
#define RIGHT_TITLEBUTTON 306
#define NUMBER 307
#define KEYWORD 308
#define NKEYWORD 309
#define CKEYWORD 310
#define CLKEYWORD 311
#define FKEYWORD 312
#define FSKEYWORD 313
#define SKEYWORD 314
#define DKEYWORD 315
#define JKEYWORD 316
#define WINDOW_RING 317
#define WARP_CURSOR 318
#define ERRORTOKEN 319
#define NO_STACKMODE 320
#define STRING 321
#define ICONS 270
#define COLOR 271
#define SAVECOLOR 272
#define MONOCHROME 273
#define FUNCTION 274
#define WINDOW_FUNCTION 275
#define ZOOM 276
#define MAKE_TITLE 277
#define GRAYSCALE 278
#define NO_TITLE 279
#define AUTO_RAISE 280
#define ICON_REGION 281
#define META 282
#define SHIFT 283
#define LOCK 284
#define CONTROL 285
#define WINDOW 286
#define TITLE 287
#define ICON 288
#define ROOT 289
#define FRAME 290
#define COLON 291
#define EQUALS 292
#define START_ICONIFIED 293
#define MOVE 294
#define RESIZE 295
#define WAIT 296
#define SELECT 297
#define KILL 298
#define LEFT_TITLEBUTTON 299
#define RIGHT_TITLEBUTTON 300
#define NUMBER 301
#define KEYWORD 302
#define NKEYWORD 303
#define CKEYWORD 304
#define CLKEYWORD 305
#define FKEYWORD 306
#define FSKEYWORD 307
#define SKEYWORD 308
#define DKEYWORD 309
#define JKEYWORD 310
#define WINDOW_RING 311
#define WARP_CURSOR 312
#define ERRORTOKEN 313
#define NO_STACKMODE 314
#define STRING 315
#ifndef YYSTYPE_DEFINED
#define YYSTYPE_DEFINED
typedef union

View File

@ -110,13 +110,12 @@ static void yyerror ( const char *s );
};
%token <num> LB RB LP RP MENUS MENU BUTTON DEFAULT_FUNCTION PLUS MINUS
%token <num> ALL OR CURSORS PIXMAPS ICONS COLOR SAVECOLOR MONOCHROME FUNCTION
%token <num> ALL OR CURSORS ICONS COLOR SAVECOLOR MONOCHROME FUNCTION
%token <num> WINDOW_FUNCTION ZOOM
%token <num> MAKE_TITLE GRAYSCALE
%token <num> NO_TITLE AUTO_RAISE NO_HILITE ICON_REGION
%token <num> NO_TITLE AUTO_RAISE ICON_REGION
%token <num> META SHIFT LOCK CONTROL WINDOW TITLE ICON ROOT FRAME
%token <num> COLON EQUALS SQUEEZE_TITLE DONT_SQUEEZE_TITLE
%token <num> START_ICONIFIED NO_TITLE_HILITE TITLE_HILITE
%token <num> COLON EQUALS START_ICONIFIED
%token <num> MOVE RESIZE WAIT SELECT KILL LEFT_TITLEBUTTON RIGHT_TITLEBUTTON
%token <num> NUMBER KEYWORD NKEYWORD CKEYWORD CLKEYWORD FKEYWORD FSKEYWORD
%token <num> SKEYWORD DKEYWORD JKEYWORD WINDOW_RING WARP_CURSOR ERRORTOKEN
@ -124,9 +123,9 @@ static void yyerror ( const char *s );
%token <ptr> STRING
%type <ptr> string
%type <num> pixmap_list cursor_list color_list save_color_list stmt
%type <num> cursor_list color_list save_color_list stmt
%type <num> win_color_list win_list function menu
%type <num> noarg sarg error narg squeeze color_entry
%type <num> noarg sarg error narg color_entry
%type <num> action button number signed_number full fullkey
%start twmrc
@ -143,7 +142,6 @@ stmt : error
| noarg
| sarg
| narg
| squeeze
| ICON_REGION string DKEYWORD DKEYWORD number number
{ AddIconRegion($2, $3, $4, $5, $6); }
| ZOOM number { if (Scr->FirstTime)
@ -154,7 +152,6 @@ stmt : error
}
| ZOOM { if (Scr->FirstTime)
Scr->DoZoom = TRUE; }
| PIXMAPS pixmap_list {}
| CURSORS cursor_list {}
| LEFT_TITLEBUTTON string EQUALS action {
GotTitleButton ($2, $4, False);
@ -184,14 +181,6 @@ stmt : error
}
| string fullkey { GotKey($1, $2); }
| button full { GotButton($1, $2); }
| NO_TITLE_HILITE { list = &Scr->NoTitleHighlight; }
win_list
| NO_TITLE_HILITE { if (Scr->FirstTime)
Scr->TitleHighlight = FALSE; }
| NO_HILITE { list = &Scr->NoHighlight; }
win_list
| NO_HILITE { if (Scr->FirstTime)
Scr->Highlight = FALSE; }
| NO_STACKMODE { list = &Scr->NoStackModeL; }
win_list
| NO_STACKMODE { if (Scr->FirstTime)
@ -342,18 +331,6 @@ contextkey : WINDOW { cont |= C_WINDOW_BIT; }
| string { Name = $1; cont |= C_NAME_BIT; }
;
pixmap_list : LB pixmap_entries RB
;
pixmap_entries : /* Empty */
| pixmap_entries pixmap_entry
;
pixmap_entry : TITLE_HILITE string { SetHighlightPixmap ($2); }
;
cursor_list : LB cursor_entries RB
;
@ -420,7 +397,7 @@ color_entry : CLKEYWORD string { if (!do_colorlist_keyword ($1, color,
ParseError = 1;
}
}
| CLKEYWORD string { list = do_colorlist_keyword($1,color,
| CLKEYWORD string { list = do_colorlist_keyword($1, color,
$2);
if (!list) {
twmrc_error_prefix();
@ -465,27 +442,6 @@ win_color_entry : string string { if (Scr->FirstTime &&
AddToList(list, $1, $2); }
;
squeeze : SQUEEZE_TITLE {
if (HasShape) Scr->SqueezeTitle = TRUE;
}
| SQUEEZE_TITLE { list = &Scr->SqueezeTitleL;
if (HasShape && Scr->SqueezeTitle == -1)
Scr->SqueezeTitle = TRUE;
}
LB win_sqz_entries RB
| DONT_SQUEEZE_TITLE { Scr->SqueezeTitle = FALSE; }
| DONT_SQUEEZE_TITLE { list = &Scr->DontSqueezeTitleL; }
win_list
;
win_sqz_entries : /* Empty */
| win_sqz_entries string JKEYWORD signed_number number {
if (Scr->FirstTime) {
do_squeeze_entry (list, $2, $3, $4, $5);
}
}
;
win_list : LB win_entries RB
;

View File

@ -2651,16 +2651,14 @@ BumpWindowColormap (TwmWindow *tmp, int inc)
void
SetBorder (TwmWindow *tmp, Bool onoroff)
{
if (tmp->highlight) {
if (onoroff) {
XSetWindowBorder (dpy, tmp->frame, tmp->border);
if (tmp->title_w)
XSetWindowBorder (dpy, tmp->title_w, tmp->border);
} else {
XSetWindowBorderPixmap (dpy, tmp->frame, tmp->gray);
if (tmp->title_w)
XSetWindowBorderPixmap (dpy, tmp->title_w, tmp->gray);
}
if (onoroff) {
XSetWindowBorder (dpy, tmp->frame, tmp->border);
if (tmp->title_w)
XSetWindowBorder (dpy, tmp->title_w, tmp->border);
} else {
XSetWindowBorderPixmap (dpy, tmp->frame, tmp->gray);
if (tmp->title_w)
XSetWindowBorderPixmap (dpy, tmp->title_w, tmp->gray);
}
}

View File

@ -401,7 +401,6 @@ static TwmKeyword keytable[] = {
{ "defaultfunction", DEFAULT_FUNCTION, 0 },
{ "destroy", KILL, 0 },
{ "dontmoveoff", KEYWORD, kw0_DontMoveOff },
{ "dontsqueezetitle", DONT_SQUEEZE_TITLE, 0 },
{ "east", DKEYWORD, D_EAST },
{ "f", FRAME, 0 },
{ "f.autoraise", FKEYWORD, F_AUTORAISE },
@ -499,7 +498,6 @@ static TwmKeyword keytable[] = {
{ "nobackingstore", KEYWORD, kw0_NoBackingStore },
{ "nodefaults", KEYWORD, kw0_NoDefaults },
{ "nograbserver", KEYWORD, kw0_NoGrabServer },
{ "nohighlight", NO_HILITE, 0 },
{ "nomenushadows", KEYWORD, kw0_NoMenuShadows },
{ "noraiseondeiconify", KEYWORD, kw0_NoRaiseOnDeiconify },
{ "noraiseonmove", KEYWORD, kw0_NoRaiseOnMove },
@ -510,10 +508,8 @@ static TwmKeyword keytable[] = {
{ "nostackmode", NO_STACKMODE, 0 },
{ "notitle", NO_TITLE, 0 },
{ "notitlefocus", KEYWORD, kw0_NoTitleFocus },
{ "notitlehighlight", NO_TITLE_HILITE, 0 },
{ "noversion", KEYWORD, kw0_NoVersion },
{ "opaquemove", KEYWORD, kw0_OpaqueMove },
{ "pixmaps", PIXMAPS, 0 },
{ "pointerbackground", CKEYWORD, kwc_PointerBackground },
{ "pointerforeground", CKEYWORD, kwc_PointerForeground },
{ "priority", NKEYWORD, kwn_Priority },
@ -530,7 +526,6 @@ static TwmKeyword keytable[] = {
{ "select", SELECT, 0 },
{ "shift", SHIFT, 0 },
{ "south", DKEYWORD, D_SOUTH },
{ "squeezetitle", SQUEEZE_TITLE, 0 },
{ "starticonified", START_ICONIFIED, 0 },
{ "t", TITLE, 0 },
{ "title", TITLE, 0 },
@ -538,7 +533,6 @@ static TwmKeyword keytable[] = {
{ "titlebuttonborderwidth", NKEYWORD, kwn_TitleButtonBorderWidth },
{ "titlefont", SKEYWORD, kws_TitleFont },
{ "titleforeground", CLKEYWORD, kwcl_TitleForeground },
{ "titlehighlight", TITLE_HILITE, 0 },
{ "titlepadding", NKEYWORD, kwn_TitlePadding },
{ "unknownicon", SKEYWORD, kws_UnknownIcon },
{ "usepposition", SKEYWORD, kws_UsePPosition },
@ -994,53 +988,3 @@ ParseUsePPosition (char *s)
return -1;
}
/**
*
* \param list squeeze or dont-squeeze list
* \param name window name
* \param justify left, center, or right
* \param num signed num
* \param denom 0 or indicates fraction denom
*/
void
do_squeeze_entry (name_list **list, char *name, int justify, int num, int denom)
{
int absnum = (num < 0 ? -num : num);
if (denom < 0) {
twmrc_error_prefix();
fprintf (stderr, "negative SqueezeTitle denominator %d\n", denom);
return;
}
if (absnum > denom && denom != 0) {
twmrc_error_prefix();
fprintf (stderr, "SqueezeTitle fraction %d/%d outside window\n",
num, denom);
return;
}
if (denom == 1) {
twmrc_error_prefix();
fprintf (stderr, "useless SqueezeTitle faction %d/%d, assuming 0/0\n",
num, denom);
num = 0;
denom = 0;
}
if (HasShape) {
SqueezeInfo *sinfo;
sinfo = malloc (sizeof(SqueezeInfo));
if (!sinfo) {
twmrc_error_prefix();
fprintf (stderr, "unable to allocate %ld bytes for squeeze info\n",
(unsigned long)sizeof(SqueezeInfo));
return;
}
sinfo->justify = justify;
sinfo->num = num;
sinfo->denom = denom;
AddToList (list, name, (char *) sinfo);
}
}

View File

@ -76,9 +76,6 @@ extern int ParseTwmrc ( char *filename );
extern int parse_keyword ( char *s, int *nump );
extern void TwmOutput ( int c );
extern void twmUnput ( int c );
extern void do_squeeze_entry ( name_list **list, char *name, int justify,
int num, int denom );
extern int (*twmInputFunc)(void);
extern int ConstrainedMoveTime;

View File

@ -782,7 +782,7 @@ void SetupFrame (TwmWindow *tmp_win, int x, int y, int w, int h, int bw, Bool se
ComputeWindowTitleOffsets (tmp_win, xwc.width, True);
reShape = (tmp_win->wShaped ? TRUE : FALSE);
if (tmp_win->squeeze_info) /* check for title shaping */
if (tmp_win->squeeze) /* check for title shaping */
{
title_width = tmp_win->rightx + Scr->TBInfo.rightoff;
if (title_width < xwc.width)
@ -1023,7 +1023,7 @@ SetFrameShape (TwmWindow *tmp)
/*
* can optimize rectangular contents window
*/
if (tmp->squeeze_info) {
if (tmp->squeeze) {
XRectangle newBounding[2];
XRectangle newClip[2];
int fbw2 = 2 * tmp->frame_bw;

View File

@ -158,12 +158,8 @@ typedef struct ScreenInfo
name_list *MakeTitle; /* list of window names with title bar */
name_list *AutoRaise; /* list of window names to auto-raise */
name_list *IconNames; /* list of window names and icon names */
name_list *NoHighlight; /* list of windows to not highlight */
name_list *NoStackModeL; /* windows to ignore stack mode requests */
name_list *NoTitleHighlight;/* list of windows to not highlight the TB*/
name_list *StartIconified; /* windows to start iconic */
name_list *SqueezeTitleL; /* windows of which to squeeze title */
name_list *DontSqueezeTitleL; /* windows of which not to squeeze */
name_list *WindowRingL; /* windows in ring */
name_list *WarpCursorL; /* windows to warp cursor to on deiconify */
@ -216,15 +212,12 @@ typedef struct ScreenInfo
short SaveUnder; /* use save under's for menus */
short RandomPlacement; /* randomly place windows that no give hints */
short OpaqueMove; /* move the window rather than outline */
short Highlight; /* should we highlight the window borders */
short StackMode; /* should we honor stack mode requests */
short TitleHighlight; /* should we highlight the titlebar */
short MoveDelta; /* number of pixels before f.move starts */
short ZoomCount; /* zoom outline count */
short Shadow; /* show the menu shadow */
short InterpolateMenuColors;/* make pretty menus */
short ClientBorderWidth; /* respect client window border width */
short SqueezeTitle; /* make title as small as possible */
short HaveFonts; /* set if fonts have been loaded */
short FirstTime; /* first time we've read .twmrc */
short CaseSensitive; /* be case-sensitive when sorting names */

View File

@ -345,7 +345,7 @@ main(int argc, char *argv[])
if (restore_filename)
ReadWinConfigFile (restore_filename);
HasShape = XShapeQueryExtension (dpy, &ShapeEventBase, &ShapeErrorBase);
HasShape = XShapeQueryExtension(dpy, &ShapeEventBase, &ShapeErrorBase);
HasSync = XSyncQueryExtension(dpy, &SyncEventBase, &SyncErrorBase);
TwmContext = XUniqueContext();
MenuContext = XUniqueContext();
@ -444,12 +444,8 @@ main(int argc, char *argv[])
Scr->MakeTitle = NULL;
Scr->AutoRaise = NULL;
Scr->IconNames = NULL;
Scr->NoHighlight = NULL;
Scr->NoStackModeL = NULL;
Scr->NoTitleHighlight = NULL;
Scr->StartIconified = NULL;
Scr->SqueezeTitleL = NULL;
Scr->DontSqueezeTitleL = NULL;
Scr->WindowRingL = NULL;
Scr->WarpCursorL = NULL;
/* remember to put an initialization in InitVariables also
@ -522,7 +518,6 @@ main(int argc, char *argv[])
Scr->siconifyPm = None;
Scr->pullPm = None;
Scr->hilitePm = None;
Scr->tbpm.xlogo = None;
Scr->tbpm.resize = None;
Scr->tbpm.question = None;
@ -535,7 +530,6 @@ main(int argc, char *argv[])
/* Parse it once for each screen. */
ParseTwmrc(InitFile);
assign_var_savecolor(); /* storeing pixels for twmrc "entities" */
if (Scr->SqueezeTitle == -1) Scr->SqueezeTitle = FALSE;
if (!Scr->HaveFonts) CreateFonts();
CreateGCs();
MakeMenus();
@ -656,12 +650,8 @@ InitVariables(void)
FreeList(&Scr->MakeTitle);
FreeList(&Scr->AutoRaise);
FreeList(&Scr->IconNames);
FreeList(&Scr->NoHighlight);
FreeList(&Scr->NoStackModeL);
FreeList(&Scr->NoTitleHighlight);
FreeList(&Scr->StartIconified);
FreeList(&Scr->SqueezeTitleL);
FreeList(&Scr->DontSqueezeTitleL);
FreeList(&Scr->WindowRingL);
FreeList(&Scr->WarpCursorL);
@ -732,15 +722,12 @@ InitVariables(void)
Scr->SaveUnder = TRUE;
Scr->RandomPlacement = FALSE;
Scr->OpaqueMove = FALSE;
Scr->Highlight = TRUE;
Scr->StackMode = TRUE;
Scr->TitleHighlight = TRUE;
Scr->MoveDelta = 1; /* so that f.deltastop will work */
Scr->ZoomCount = 8;
Scr->Shadow = TRUE;
Scr->InterpolateMenuColors = FALSE;
Scr->ClientBorderWidth = FALSE;
Scr->SqueezeTitle = -1;
Scr->FirstRegion = NULL;
Scr->LastRegion = NULL;
Scr->FirstTime = TRUE;

View File

@ -169,12 +169,6 @@ typedef struct _TBWindow {
TitleButton *info; /* description of this window */
} TBWindow;
typedef struct _SqueezeInfo {
int justify; /* left, center, right */
int num; /* signed pixel count or numerator */
int denom; /* 0 for pix count or denominator */
} SqueezeInfo;
#define J_LEFT 1
#define J_CENTER 2
#define J_RIGHT 3
@ -270,11 +264,9 @@ typedef struct TwmWindow
short forced; /* has had an icon forced upon it */
short icon_not_ours; /* icon pixmap or window supplied to us */
short icon_moved; /* user explicitly moved the icon */
short highlight; /* should highlight this window */
short stackmode; /* honor stackmode requests */
short transient; /* this is a transient window */
Window transientfor; /* window contained in XA_XM_TRANSIENT_FOR */
short titlehighlight; /* should I highlight the title bar */
int save_frame_x; /* x position of frame */
int save_frame_y; /* y position of frame */
int save_frame_width; /* width of frame */
@ -284,7 +276,7 @@ typedef struct TwmWindow
unsigned long protocols; /* which protocols this window handles */
Colormaps cmaps; /* colormaps for this application */
TBWindow *titlebuttons;
SqueezeInfo *squeeze_info; /* should the title be squeezed? */
Bool squeeze; /* should the title be squeezed? */
struct {
struct TwmWindow *next, *prev;
Bool cursor_valid;