Compare commits

...

58 Commits

Author SHA1 Message Date
Morgan Aldridge
8eb3738420 Updated mlvwm version number to 0.9.4 2021-09-09 11:40:07 -04:00
Morgan Aldridge
5d6b7e17c5 Updated CHANGELOG re:fixed xdotool window move & new SwallowFocusClick config command. Issue #25, Issue #24. 2021-09-09 11:23:00 -04:00
Morgan Aldridge
7a3daaebf4 Updated manual page to describe the new 'SwallowFocusClick' config command. Issue #24 2021-09-09 11:08:41 -04:00
Morgan Aldridge
2d324d13cf Updated handle_button_press() to appropriately pass initial click in inactive windows, plus added 'SwallowFocusClick' config command to disable the functionality. Issue #24 2021-09-09 11:01:44 -04:00
Morgan Aldridge
f6b4a84199 Fixed config file parsing to prevent false-positive command matches in some edge cases 2021-09-09 10:57:44 -04:00
Morgan Aldridge
692432b807 Update handle_configure_request() to not modify tmp_win before calling SetUpFrame(), plus reduced vars used. Issue #25 2021-09-05 11:07:17 -04:00
Morgan Aldridge
b039615084 Uncomment setting tmp_win->frame_x & tmp_win->frame_y in handle_configure_request() to fix xdotool not moving windows. Issue #25 2021-09-05 10:53:24 -04:00
Morgan Aldridge
24578885f2 META: Fix broken screenshot thumbnails in README.md 2021-05-30 10:38:48 -04:00
Morgan Aldridge
694d9c26a1 META: Added screenshots to README.md 2021-05-30 10:34:38 -04:00
Morgan Aldridge
70e08cf7cf Updated mlvwm version number to 0.9.3 2021-04-01 08:29:26 -04:00
Morgan Aldridge
71b9f4bb7a Updated CHANGELOG re:styling improvements. Issue #16 2021-03-25 16:15:02 -04:00
Morgan Aldridge
7bbc1f1bde Added initial CONTRIBUTING.md and linked to from README.md. Issue #14 2021-03-25 09:05:41 -04:00
Morgan Aldridge
9aaa7f42a6 Updated README.md Installation section to note installing via package managers 2021-03-25 09:00:44 -04:00
Morgan Aldridge
eb4c348b6a Fix typo & spacing in History section of README.md 2021-03-25 08:51:31 -04:00
Morgan Aldridge
885f80f1e0 META: ignore vim temporary files 2021-03-25 08:21:03 -04:00
Morgan Aldridge
1abad78a41 Grayscale scroll bar background pattern for default theme. Issue #16 2021-03-24 09:10:01 -04:00
Morgan Aldridge
6984cda115 More accurate rendering of title bar, esp. for default System7 theme. Issue #16 2021-03-24 08:11:46 -04:00
Morgan Aldridge
5fd232652b More accurate rendering & positioning of close & min/max title bar buttons, esp. for default System7 theme. Issue #16 2021-03-24 07:34:35 -04:00
Morgan Aldridge
708a30f602 Fixed top left & right rounded corners in System8 theme. Issue #16, issue #17 2021-03-18 09:48:22 -04:00
Morgan Aldridge
9a32e76a33 Reduce window shadows by 1px. Issue #16, issue #20 2021-03-17 17:58:38 -04:00
Morgan Aldridge
e822ec57b9 Merge branch 'master' into scroll-bar-theme-improvements 2021-03-17 15:27:52 -04:00
Morgan Aldridge
c4fc6df49c Merge branch 'TheMorc-pixelmodifications' into master 2021-03-17 15:16:55 -04:00
Morgan Aldridge
e0823a6a15 Borders: Restore stripes around titlebar buttons & text on monochrome displays 2021-03-17 15:08:33 -04:00
Morgan Aldridge
89a829e8e2 Merge branch 'pixelmodifications' of https://github.com/TheMorc/mlvwm into TheMorc-pixelmodifications 2021-03-17 14:45:59 -04:00
Morgan Aldridge
817ec609b9 More accurate rendering of scroll bars. Issue #16 2021-03-14 13:09:58 -04:00
Morgan Aldridge
c1c65d7a44 Updated manual page to reflect new default ScrollBarWidth. Issue #16 2021-03-14 11:47:18 -04:00
Morgan Aldridge
6822305905 More accurate rendering of scroll bars. Issue #16 2021-03-14 11:40:42 -04:00
Morgan Aldridge
da10f2cf46 More accurate rendering of resize boxes. Issue #16 2021-03-13 10:01:41 -05:00
Morgan Aldridge
95da6807a5 More accurate rendering of scrollbars. Issue #16 2021-03-13 09:28:23 -05:00
Morgan Aldridge
352a147fc8 Default scrollbar width to 16px. Issue #16 2021-03-13 09:27:36 -05:00
Morgan Aldridge
7d51d64c60 Merge branch 'pixelmodifications' of https://github.com/TheMorc/mlvwm into TheMorc-pixelmodifications 2021-03-12 13:23:15 -05:00
Morgan Aldridge
e4a31ff47a Updated CHANGELOG regarding new RoundedScreenCorners configuration setting. Issue #15 2021-03-12 12:09:00 -05:00
Morgan Aldridge
da399d1bd9 Added RoundedScreenCorners config setting to manual page. Issue #15 2021-03-12 12:05:40 -05:00
Morgan Aldridge
30eecc92de
Merge pull request #12 from TheMorc/roundedcorners
Add RoundedScreenCorners config setting. Issue #15
2021-03-12 11:59:21 -05:00
TheMorc
8370f234a2 MLVWM: change the default font size from 14 to 12 2021-03-10 18:42:32 +01:00
TheMorc
b36ef7942d Borders: Fix stripes and whitespace around titlebar buttons & text 2021-03-10 18:42:32 +01:00
Morgan Aldridge
ed66d041e8 Merge branch 'pixelmodifications' of https://github.com/TheMorc/mlvwm into TheMorc-pixelmodifications 2021-03-07 15:33:31 -05:00
TheMorc
464b322653 MLVWM: change the default font size from 14 to 12 2021-03-07 20:36:21 +01:00
TheMorc
02d34fa5dd Borders: Fix stripes and whitespace around titlebar buttons & text 2021-03-07 20:36:21 +01:00
Morgan Aldridge
b02b7a0a95 Merge branch 'pixelmodifications' of https://github.com/TheMorc/mlvwm into TheMorc-pixelmodifications 2021-03-07 13:28:03 -05:00
Morgan Aldridge
d40c836bba
Merge pull request #11 from TheMorc/gitignore
Meta: Add .gitignore
2021-03-07 12:54:53 -05:00
TheMorc
5770821197 Meta: Add .gitignore
Adding .gitignore so we don't mistakenly push compiled stuff over
to the repo. Now also with ignored files for QtCreator.
2021-03-07 18:48:00 +01:00
TheMorc
9ea97d0641 Borders: Fix stripes and whitespace around titlebar buttons & text 2021-03-07 11:38:52 +01:00
TheMorc
882e556d35 Add_Window&Borders: Move placement of titlebar buttons
These changes don't seem to break the System7 theme at all.
2021-03-07 11:17:39 +01:00
TheMorc
0a3517159f Borders&Event: Fix rectangle size on MinMax button 2021-03-07 10:58:19 +01:00
TheMorc
4cd1d76fe1 Menus: Change menubar size to 20 2021-03-07 10:55:35 +01:00
TheMorc
8370be7cc1 Add RoundedScreenCorners config setting
This setting enables drawing of all rounded screen corners

(small interesting thing: Mac OS 9 had rounded screen corners but
they must've disabled them later because I don't have them on my
snow 2003 iBook G3.)
2021-03-06 19:35:32 +01:00
Morgan Aldridge
4910df83f7 Update CHANGELOG 2021-01-30 15:06:32 -05:00
Morgan Aldridge
09ea1b39d4 Duplicate command string in RestartSystem() as it'll get freed in Done() before it's used. Issue #10 2021-01-30 15:01:56 -05:00
Morgan Aldridge
e65b6ff507 Added new README.md for GitHub 2020-12-31 10:12:57 -05:00
Morgan Aldridge
3eabf02106 Update CHANGELOG 2020-12-30 18:03:51 -05:00
Morgan Aldridge
0121f255f8 Merge branch 'sprintf-to-snprintf' 2020-12-30 18:02:43 -05:00
Morgan Aldridge
b6b147bdfe Update man page authors section and add a history section 2020-12-30 17:50:43 -05:00
Morgan Aldridge
5c4b663a68 Updated man page to include description of EdgeResistance configuration option. Issue #8 2020-12-30 17:34:59 -05:00
Morgan Aldridge
5ed03df783 Convert strcat()s to snprintf()s. Issue #6 2020-12-27 11:30:39 -05:00
Morgan Aldridge
7c8f22ff56 Convert sprintf()s to snprintf()s. Issue #6 2020-12-25 20:51:46 -05:00
Morgan Aldridge
67e74cbdd1 Fix compiler warnings 2020-12-22 17:14:05 -05:00
Morgan Aldridge
6c2a9da7c6 Updated TaC's email address in copyright headers, at his request 2020-12-19 12:35:02 -05:00
32 changed files with 474 additions and 240 deletions

6
.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
man/mlvwm._man
mlvwm/mlvwm
**/Makefile*
**/*.o
mlvwm.*
**/*.swp

View File

@ -1,3 +1,19 @@
0.9.2 -> 0.9.4
Improved config command parsing in ReadConfigFile()
Add SwallowFocusClick configuration command
Fixed handle_configure_request() to support moving windows
0.9.2 -> 0.9.3
Fix RestartSystem()/Done() to correctly restart into other window managers
Add RoundedScreenCorners configuration
Changed default font size to 12px
Changed default scroll bar width/height to 16px
Changed default menu bar height to 20px
More accurate sizing & styling of window title bars & controls, scroll bars, and resize handle
0.9.1 -> 0.9.2
Change sprintf() & strcat() to snprintf()
0.9.0 -> 0.9.1
change Restack
change menu selected functions

37
CONTRIBUTING.md Normal file
View File

@ -0,0 +1,37 @@
# Contributing to MLVWM
We welcome feedback, bug fixes, and feature request. Ultimately, what gets accepted and merged into the project is up to the current project maintainer ([Morgan Aldridge](https://github.com/morgant)) and what they feel is appropriate for all users of the project, but you are encouraged to submit any suggestions.
Please submit bugs and feature requests via the projects [issue tracker](https://github.com/morgant/mlvwm/issues).
## What You Need
You will need the following to contribute:
* A [GitHub](http://github.com) account for submitting pull requests
* X11
## Making Changes
Follow these steps when making changes. That way, they will most likely be accepted with few headaches and very little back and forth.
1. Fork the [mlvwm](https://github.com/morgant/mlvwm) project on GitHub.
2. Create a topic branch from the `master` branch. Name your branch appropriately, reflecting the intended changes (e.g. “sprintf-to-snprintf” or “scroll-bar-theme-improvements”)
3. Make your edits (please try to conform to our [style guide](#style-guide)).
4. Make commits in logical units and with concise but explanatory commit messages. Please reference any appropriate issue numbers, e.g. "Issue #16".
5. Ensure your changes build without additional warnings or errors. We suggest testing in `Xephyr`.
## Submitting Changes
When youve completed your changes and are ready to merge them into the main project, follow these steps to submit them for review.
1. Push the changes to your fork of the [mlvwm](https://github.com/morgant/mlvwm) project on GitHub
2. Submit a pull request to the [mlvwm](https://github.com/morgant/mlvwm) project
Thats all there is to it.
If you followed the [making changes](#making-changes) guidelines and the changes are aligned with the vision of the project, it should be a smooth process to merge them.
## Style Guide
This is a very old codebase from before syle guides were a thing and we haven't yet tackled standardizing the formatting. So, for the time being, please try to use the same style as surrounding code, including either spaces or tabs for indendation (whichever is used locally), spacing around parentheses, etc. Please remove any trailing whitespace from lines.

83
README.md Normal file
View File

@ -0,0 +1,83 @@
# MLVWM
[![MLVWM System 7 Theme](/img/System7-640x360.png?raw=true)](#SCREENSHOTS)
## OVERVIEW
MLVWM (Macintosh-Like Virtual Window Manager) is an X11 window manager with a classic MacOS appearance. Its primary features include:
* Emulation of MacOS 7 & 8 menu bar & window decorations
* Optional multiple virtual desktops
* A main menu bar across the top of the screen, with:
* Configurable global and per-application menus
* Menu items trigger application functionality via keyboard shorcuts or commands
* An icon menu which shows all windows and supports:
* Switching desktops
* Selecting, hiding, and showing windows
* A balloon help menu
* The ability to "swallow" small windows into the menu bar
* Windows which support:
* Title bars with optional close, zoom, and shade buttons
* Resize handle
* Optional double-click to toggle window shade
* Drag as solid window or just outline
* Balloon help which shows X window information
* Global keyboard shortcuts
* Numerous configuration options to tune functionality
## SCREENSHOTS
Default theme (System 7-like):
[![Default System 7 Theme](/img/System7-640x360.png?raw=true)](/img/System7-1920x1080.png)
`System8` theme (MacOS 8/9-like):
[![MacOS 8/9 Theme](/img/MacOS8-640x360.png?raw=true)](/img/MacOS8-1920x1080.png)
## INSTALLATION
### Building from Source
Build & installation currently still requires [imake](https://en.wikipedia.org/wiki/Imake) & make. While the original documentation says that `xmkmf -a` should work, we've found it's usually necessary to do the following:
cd man && xmkmf && cd -
cd sample_rc && xmkmf && cd -
cd mlvwm && xmkmf && cd -
xmkmf
make && make install
### Package Managers
Native packages are provided on some operating systems, including:
* OpenBSD: `pkg_add mlvwm`
## CONFIGURATION
While some sample configuration files are included in the `sample_rc` directory, we highly suggest using the configuration files from the [mlvwmrc](https://github.com/morgant/mlvwmrc) project.
## DOCUMENTATION
We suggest reading the manual page (`man mlvwm`; English), but you may also find the original documentation helpful:
* README: [English](README), [日本語](README.jp)
* CONFIGURATION: [English](CONFIGURATION), [日本語](CONFIGURATION.jp)
* CHANGELOG: [English](CHANGELOG), [日本語](CHANGELOG.jp)
* Website: [English](http://www2u.biglobe.ne.jp/~y-miyata/mlvwm.html)
Note: the English documentation above was automatically generated from the Japanese documentation.
## CONTRIBUTING
Contributions are welcome and appreciated. Please read and follow the [CONTRIBUTING](CONTRIBUTING.md) guidelines.
## HISTORY
MLVWM was originally developed in 1997 by Takashi HASEGAWA, based on FVWM, while studying at Nagoya University. Active development proceeded through 2000. In 2020, Morgan Aldridge obtained permission to continue maintenance & development.
## LICENSE
This software is distributed as freeware as long as the original copyright remains in the source code and all documentation. Some files retain their original MIT license and one file is in the public domain.
Macintosh and MacOS are registered trademarks of Apple, Inc. (née Apple Computer, Inc.)

BIN
img/MacOS8-1920x1080.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 134 KiB

BIN
img/MacOS8-640x360.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

BIN
img/System7-1920x1080.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 132 KiB

BIN
img/System7-640x360.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 109 KiB

View File

@ -149,12 +149,20 @@ focus in the current one. This is not set up by default.
.IP "\fBSlopyFocus\fP"
It turns on FollowToMouse with the modification of not loosing
focus when in the root window.
.IP "\fBSwallowFocusClick\fP"
Initial clicks in inactive windows will be ignored. This is not set by
default.
.IP "\fBSystem8\fP"
Change to window decoration to System 8(Only Color Monitor).
.IP "\fBRoundedScreenCorners\fP"
Enable rounded screen corners.
.IP "\fBOpaqueMove\fP"
Enable Opaque move.
.IP "\fBOpaqueResize\fP"
Enable Opaque resize.
.IP "\fBEdgeResistance\fP \fIx\fP \fIy\fP"
Determines the amount of force needed to drag a window beyond the bounds
of the screen. Default is 0px. The unit is px.
.IP "\fBOneClickMenu\fP"
Click pull down menu and more one click execute selection.
.IP "\fBZoomWait\fP \fIms\fB"
@ -168,7 +176,7 @@ WindowShade is regarded as Inocify.
.IP "\fBIconifyHide\fP"
HideWindow is regarded as Iconify.
.IP "\fBScrollBarWidth\fP \fIn\fP
The variable scroll window is set \fIn\fP and defaults to 19 if
The variable scroll window is set \fIn\fP and defaults to 16 if
unspecified.
.IP "\fBFlushMenu\fP \fIspeed\fP \fIflashes\fP"
Determines how fast the flashes are when you choose an option from a menu,
@ -367,6 +375,14 @@ the author.
Macintosh is a registered trademark of Apple Computer, Inc.
.SH AUTHOR
.SH AUTHORS
TakaC HASEGAWA
.I hase@rop2.hitachi-cable.co.jp
.I tac.hasegawa@gmail.com
Morgan Aldridge
.I morgant@makkintosshu.com
.SH HISTORY
.I mlvwm
was developed by TakaC HASEGAWA in 1997 and is based on the FVWM window
manager.

View File

@ -2,7 +2,7 @@ XCOMM Imakefile for MLVWM
#include "../configure.h"
VERSION = 0.9.1
VERSION = 0.9.4
COMPILE_OPTIONS = -DVERSION=\"$(VERSION)\" \
-DCONFIGNAME=\"$(MLVWMRC)\" \
-DMLVWMLIBDIR=\"$(MLVWMLIBDIR)\"

View File

@ -1,4 +1,4 @@
VERSION=\"0.9.0\"
VERSION=\"0.9.3\"
CFLAGS = -g -Wall -DVERSION=$(VERSION) -fpcc-struct-return -DCONFIGNAME=\".mlvwmrc\" -DUSE_LOCALE -DMLVWMLIBDIR=\"/usr/X11R6/lib/X11/mlvwm\"
CC = gcc
LDFLAGS = -lXpm -lXext -lX11

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is based on fvwm, but has been siginificantly modified */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/****************************************************************************/
/****************************************************************************
* This module is based on Twm, but has been siginificantly modified
@ -35,6 +35,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mlvwm.h"
#include "screen.h"
@ -203,7 +204,7 @@ void create_titlebar( MlvwmWindow *tmp_win )
if( tmp_win->flags&CLOSER ){
attributes.cursor = Scr.MlvwmCursors[DESTROY];
tmp_win->close_b = XCreateWindow( dpy, tmp_win->title_w,
Scr.flags&SYSTEM8?4:BOXSIZE+1,
Scr.flags&SYSTEM8?2:BOXSIZE-3,
(TITLE_HEIGHT-BOXSIZE)/2,
BOXSIZE, BOXSIZE, 0,
CopyFromParent, InputOutput,
@ -214,7 +215,7 @@ void create_titlebar( MlvwmWindow *tmp_win )
if( tmp_win->flags&MINMAXR ){
attributes.cursor = Scr.MlvwmCursors[SELECT];
tmp_win->minmax_b = XCreateWindow( dpy, tmp_win->title_w,
tmp_win->frame_w-BOXSIZE*2-1,
tmp_win->frame_w-(BOXSIZE*2-3),
(TITLE_HEIGHT-BOXSIZE)/2,
BOXSIZE, BOXSIZE, 0,
CopyFromParent, InputOutput,

View File

@ -1,6 +1,6 @@
/****************************************************************************
* This module is all original code
* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp
* by TakaC Hasegawa (tac.hasegawa@gmail.com)
* Copyright 1996, TakaC Hasegawa
* You may use this code for any purpose, as long as the original
* copyright remains in the source code and all documentation

View File

@ -1,17 +1,19 @@
/****************************************************************************/
/* This module is mostly all new */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996 TakaC Hasegawa. No restrictions are placed on this code, */
/* as long as the copyright notice is preserved */
/****************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mlvwm.h"
#include "screen.h"
#include "misc.h"
#include "event.h"
#include "balloon.h"
#include <X11/extensions/shape.h>
@ -155,7 +157,7 @@ void ShapeBalloon( int fx, int fy, int xoff, int yoff, int woff, int hoff, int w
void BalloonSize( int *lh, int *lw, int *offset, int *w, int *h, MlvwmWindow *mw )
{
int lp;
char contents[256];
char contents[MAX_BALLOON_STR_LEN];
int contents_width=0, strw, strh;
int xinc, yinc;
@ -222,7 +224,7 @@ void BalloonSize( int *lh, int *lw, int *offset, int *w, int *h, MlvwmWindow *mw
void DrawWindowBalloon( int xoff, int yoff, int lh, int offset, int lw, MlvwmWindow *mw )
{
int lp;
char contents[255];
char contents[MAX_BALLOON_STR_LEN];
int xinc, yinc;
for( lp=0; WinLabel[lp]!=NULL; lp++ ){

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */
@ -8,5 +8,7 @@
#ifndef _BALLOON_
#define _BALLOON_
#define MAX_BALLOON_STR_LEN 255
extern void BalloonHelp( void );
#endif /* _BALLOON_ */

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is based on fvwm, but has been siginificantly modified */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/****************************************************************************/
/****************************************************************************
* This module is based on Twm, but has been siginificantly modified
@ -55,13 +55,13 @@ void DrawShadowBox( int x, int y, int w, int h, Window win, int d, GC hilight, G
h--;
for( lp=0; lp<d; lp++ ){
if( mode&SHADOW_BOTTOM )
XDrawLine( dpy, win, shadow, x+lp, y+h-lp, x+w-lp, y+h-lp );
XDrawLine( dpy, win, shadow, x+lp+1, y+h-lp, x+w-lp, y+h-lp );
if( mode&SHADOW_LEFT )
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+lp, y+h-lp );
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+lp, y+h-lp-1 );
if( mode&SHADOW_TOP )
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+w-lp, y+lp );
XDrawLine( dpy, win, hilight, x+lp, y+lp, x+w-lp-1, y+lp );
if( mode&SHADOW_RIGHT )
XDrawLine( dpy, win, shadow, x+w-lp, y+lp, x+w-lp, y+h-lp );
XDrawLine( dpy, win, shadow, x+w-lp, y+lp+1, x+w-lp, y+h-lp-1 );
}
}
@ -129,15 +129,15 @@ void SetUpFrame( MlvwmWindow *t, int x, int y, int w, int h, Bool sendEvent )
if( t->flags&MINMAXR ){
if( Scr.flags&SYSTEM8 )
XMoveWindow(dpy, t->minmax_b,
w-BOXSIZE-9-(t->flags&SHADER?BOXSIZE+4:0),
w-BOXSIZE-7-(t->flags&SHADER?BOXSIZE+4:0),
(TITLE_HEIGHT-BOXSIZE)/2);
else
XMoveWindow(dpy, t->minmax_b,
w-BOXSIZE*2-1,
w-(BOXSIZE*2-2),
(TITLE_HEIGHT-BOXSIZE)/2);
}
if( t->flags&SHADER )
XMoveWindow(dpy, t->shade_b, w-BOXSIZE-9,
XMoveWindow(dpy, t->shade_b, w-BOXSIZE-8,
(TITLE_HEIGHT-BOXSIZE)/2);
if( !(t->flags&SHADE) ){
if( t->flags & ( TITLE | SBARV | SBARH | RESIZER ) ){
@ -246,21 +246,21 @@ void SetUpFrame( MlvwmWindow *t, int x, int y, int w, int h, Bool sendEvent )
if( (!(t->wShaped) || t->flags&SHADE) &&
t->flags & ( TITLE | SBARV | SBARH | RESIZER )){
int lp;
XRectangle rect[7];
XRectangle rect[5];
rect[0].x = -1; rect[0].y = -1;
rect[0].width = t->frame_w-1; rect[0].height = t->frame_h-1;
for( lp=0; lp<3; lp++ ){
for( lp=0; lp<2; lp++ ){
rect[lp+1].x = t->frame_w-2+lp; rect[lp+1].y = lp;
rect[lp+1].width = 1; rect[lp+1].height = t->frame_h+1-lp;
rect[lp+1].width = 1; rect[lp+1].height = t->frame_h-lp;
}
for( lp=0; lp<3; lp++ ){
rect[lp+4].x = lp; rect[lp+4].y = t->frame_h-2+lp;
rect[lp+4].width = t->frame_w+1-lp; rect[lp+4].height = 1;
for( lp=0; lp<2; lp++ ){
rect[lp+3].x = lp; rect[lp+3].y = t->frame_h-2+lp;
rect[lp+3].width = t->frame_w-lp; rect[lp+3].height = 1;
}
XShapeCombineRectangles(dpy,t->frame,ShapeBounding,
0,0,rect,7,ShapeSet,YSorted);
0,0,rect,5,ShapeSet,YSorted);
}
if( t->wShaped ) SetShape( t, w );
if (sendEvent && !(t->flags&SHADE) ){
@ -334,13 +334,13 @@ void DrawCloseBox( MlvwmWindow *t, Bool on )
if( Scr.flags&SYSTEM8 ){
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
4, (TITLE_HEIGHT-BOXSIZE)/2-2,
BOXSIZE+7, BOXSIZE+2 );
BOXSIZE+2, BOXSIZE+2 );
FillGradation( t->close_b );
}
else{
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
BOXSIZE-1, (TITLE_HEIGHT-BOXSIZE)/2-1,
BOXSIZE+4, BOXSIZE+1 );
BOXSIZE-4, (TITLE_HEIGHT-BOXSIZE)/2-1,
BOXSIZE+2, BOXSIZE+1 );
DrawShadowBox( 0, 0, BOXSIZE, BOXSIZE, t->close_b, 1,
Scr.BlackGC, Scr.WhiteGC, SHADOW_ALL );
DrawShadowBox( 1, 1, BOXSIZE-2, BOXSIZE-2, t->close_b, 1,
@ -376,23 +376,23 @@ void DrawMinMax( MlvwmWindow *t, Bool on )
if( on ){
if( Scr.flags&SYSTEM8 ){
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
t->frame_w-BOXSIZE-15-
t->frame_w-BOXSIZE-9-
(t->flags&SHADER?BOXSIZE+6:0),
(TITLE_HEIGHT-BOXSIZE)/2-1,
BOXSIZE+8, BOXSIZE+2 );
FillGradation( t->minmax_b );
XDrawRectangle( dpy, t->minmax_b, Scr.BlackGC,
1, 1, BOXSIZE-6, BOXSIZE-6 );
1, 1, BOXSIZE-7, BOXSIZE-7 );
}
else{
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
t->frame_w-BOXSIZE*2-3,(TITLE_HEIGHT-BOXSIZE)/2-1,
BOXSIZE+4, BOXSIZE+1 );
t->frame_w-(BOXSIZE*2-1),(TITLE_HEIGHT-BOXSIZE)/2-1,
BOXSIZE+2, BOXSIZE+1 );
DrawShadowBox( 0, 0, BOXSIZE, BOXSIZE, t->minmax_b, 1,
Scr.BlackGC, Scr.WhiteGC, SHADOW_ALL );
DrawShadowBox( 1, 1, BOXSIZE-2, BOXSIZE-2, t->minmax_b, 1,
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
DrawShadowBox( 1, 1, BOXSIZE-6, BOXSIZE-6, t->minmax_b, 1,
DrawShadowBox( 1, 1, BOXSIZE-5, BOXSIZE-5, t->minmax_b, 1,
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
}
}
@ -488,42 +488,32 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
while( w+20>drawable && titlelength>0 );
if( on_off ){
for( lp=4; lp<14; lp+=3 ){
if( Scr.d_depth>1 ){
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 4, lp-2, t->frame_w-15, 2, t->title_w, 1,
if( Scr.d_depth>1 && Scr.flags&SYSTEM8 ){
for( lp=4; lp<16; lp+=2 ){
DrawShadowBox( 4, lp-1, t->frame_w-14, 2, t->title_w, 1,
Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL );
else
DrawShadowBox( 4, lp-1, t->frame_w-11, 2, t->title_w, 1,
Scr.Gray1GC, Scr.WhiteGC, SHADOW_ALL );
}
else
XDrawLine( dpy, t->title_w, Scr.BlackGC,
4, lp-1, t->frame_w-7, lp-1 );
}
if( Scr.d_depth>1 ){
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 4, 14, t->frame_w-15, 2, t->title_w, 1,
Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL );
else
XDrawLine( dpy, t->title_w, Scr.Gray1GC,
4, 15, t->frame_w-9, 15 );
}
else
XDrawLine( dpy, t->title_w, Scr.BlackGC,
4, 15, t->frame_w-7, 15 );
if( Scr.flags&SYSTEM8 ){
DrawShadowBox( 0, 0, t->frame_w-2, TITLE_HEIGHT, t->title_w,
1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_TOP );
if( !(t->flags&SHADE) )
XDrawLine( dpy, t->title_w, Scr.Gray2GC,
2, TITLE_HEIGHT-1, t->frame_w-9, TITLE_HEIGHT-1 );
}
else
else{
for( lp=3; lp<15; lp+=2 ){
if( Scr.d_depth>1 )
XDrawLine( dpy, t->title_w, Scr.Gray1GC, 0, lp, t->frame_w, lp );
else
XDrawLine( dpy, t->title_w, Scr.BlackGC, 0, lp, t->frame_w, lp );
}
DrawShadowBox( 0, 0, t->frame_w-2, TITLE_HEIGHT, t->title_w,
1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
}
XFillRectangle( dpy, t->title_w, Scr.Gray4GC,
(t->frame_w-w)/2-10, 1, w+20, TITLE_HEIGHT-2 );
(t->frame_w-w)/2-5, 1, w+10, TITLE_HEIGHT-2 );
dispgc = Scr.BlackGC;
}
else{
@ -535,7 +525,7 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
if( t->flags&SHADER ) DrawShadeR( t, on_off );
XDRAWSTRING( dpy, t->title_w, WINDOWFONT, dispgc, (t->frame_w-w)/2,
TITLE_HEIGHT/2-offset, t->name, titlelength );
TITLE_HEIGHT/2-offset+(Scr.flags&SYSTEM8?0:1), t->name, titlelength );
if( Scr.d_depth<2 && !on_off ){
xgcv.function = GXor;
mask = GCFunction;
@ -549,11 +539,11 @@ void SetTitleBar( MlvwmWindow *t, Bool on_off )
}
}
void DrawArrow( Window w, int direction, GC color )
void DrawArrow( Window w, int direction, GC fill, GC outline )
{
XPoint arrow_p[] = {
{9,3},{2,10},{6,10},{6,15},{12,15},{12,10},{16,10},{9,3}, {0,0}},
arrow_p8[] = {{15,11},{9,5},{3,11},{15,11}, {0,0}};
{7,3},{2,8},{5,8},{5,12},{9,12},{9,8},{12,8},{7,3}, {0,0}},
arrow_p8[] = {{7,6},{4,9},{11,9},{8,6},{7,6}, {0,0}};
XPoint *use_p;
int lp, JunkX, point;
@ -561,8 +551,8 @@ void DrawArrow( Window w, int direction, GC color )
else use_p = arrow_p;
for( point=0; use_p[point].x!=0; point++ ){
use_p[point].x = use_p[point].x*SBAR_WH/19.+0.5;
use_p[point].y = use_p[point].y*SBAR_WH/19.+0.5;
use_p[point].x = use_p[point].x*SBAR_WH/16.;
use_p[point].y = use_p[point].y*SBAR_WH/16.;
}
if( direction==C_SBAR_LEFT || direction==C_SBAR_RIGHT ){
@ -578,8 +568,8 @@ void DrawArrow( Window w, int direction, GC color )
if( direction==C_SBAR_DOWN )
for( lp=0; lp<point; lp++ ) use_p[lp].y = SBAR_WH-use_p[lp].y-1;
XFillPolygon( dpy, w, color, use_p, point, Nonconvex, CoordModeOrigin );
XDrawLines( dpy, w, Scr.BlackGC, use_p, point, CoordModeOrigin );
XFillPolygon( dpy, w, fill, use_p, point, Nonconvex, CoordModeOrigin );
XDrawLines( dpy, w, outline, use_p, point, CoordModeOrigin );
}
void DrawSbarAnk( MlvwmWindow *t, int context, Bool on_off )
@ -618,18 +608,17 @@ void DrawSbarAnk( MlvwmWindow *t, int context, Bool on_off )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, win, 1,
Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
scale = 11*SBAR_WH/19.+0.5;
scale = 8*SBAR_WH/16.;
if( context==C_SBAR_H_AN ){
for( lp=0; lp<(SBAR_WH-6)/3; lp++ )
DrawShadowBox( (lp+1)*3, (SBAR_WH-scale)/2+1,
3, scale, win, 1,
for( lp=0; lp<(SBAR_WH-8)/2; lp++ )
DrawShadowBox( (lp+2)*2, (SBAR_WH-scale)/2,
2, scale, win, 1,
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
}
if( context==C_SBAR_V_AN ){
scale = 11*SBAR_WH/19.+0.5;
for( lp=0; lp<(SBAR_WH-6)/3; lp++ )
DrawShadowBox( (SBAR_WH-scale)/2, (lp+1)*3,
scale, 3, win, 1,
for( lp=0; lp<(SBAR_WH-8)/2; lp++ )
DrawShadowBox( (SBAR_WH-scale)/2, (lp+2)*2,
scale, 2, win, 1,
Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
}
}
@ -664,6 +653,7 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
XGCValues xgcv;
XSetWindowAttributes attributes;
Cursor cursor;
GC fill, outline;
switch( context ){
case C_SBAR_UP:
@ -704,11 +694,22 @@ void DrawSbarArrow( MlvwmWindow *t, int context, Bool on_off )
XChangeWindowAttributes( dpy, win, valuemask, &attributes );
XClearWindow( dpy, win );
if( t->flags&SCROLL && size<0 )
if( t->flags&SCROLL && size<0 ) {
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, win, 1,
Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
DrawArrow( win, context, Scr.Gray3GC );
if( Scr.flags&SYSTEM8 )
fill = outline = Scr.BlackGC;
else {
fill = Scr.Gray3GC;
outline = Scr.BlackGC;
}
}
else{
fill = outline = Scr.Gray2GC;
if( !(Scr.flags&SYSTEM8) )
fill = Scr.Gray4GC;
}
DrawArrow( win, context, fill, outline);
}
else{
mask = GCForeground;
@ -762,16 +763,29 @@ void DrawSbarBar( MlvwmWindow *t, int context, Bool on_off )
if( on_off ){
if( t->flags&SCROLL && size<0 ){
if( Scr.flags&SYSTEM8 ){
Pixmap bgpix;
bgpix = XCreatePixmap( dpy, Scr.Root, width_f,
height_f, Scr.d_depth );
XFillRectangle(dpy,bgpix,Scr.Gray3GC,0,0,width_f,height_f);
if( Scr.d_depth>1 ){
if( Scr.flags&SYSTEM8 ){
Pixmap bgpix;
bgpix = XCreatePixmap( dpy, Scr.Root, width_f,
height_f, Scr.d_depth );
XFillRectangle(dpy,bgpix,Scr.Gray3GC,0,0,width_f,height_f);
DrawShadowBox( x, y, width, height, bgpix, 1,
DrawShadowBox( x, y, width, height, bgpix, 1,
Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
XSetWindowBackgroundPixmap( dpy, win, bgpix );
XFreePixmap( dpy, bgpix );
XSetWindowBackgroundPixmap( dpy, win, bgpix );
XFreePixmap( dpy, bgpix );
}
else{
XGCValues gcv_gray4, gcv_gray2;
XGetGCValues(dpy, Scr.Gray4GC, GCForeground, &gcv_gray4);
XGetGCValues(dpy, Scr.Gray2GC, GCForeground, &gcv_gray2);
XSetWindowBackgroundPixmap( dpy, win,
XCreatePixmapFromBitmapData( dpy, Scr.Root,
mesh, mesh_w, mesh_h,
gcv_gray2.foreground,
gcv_gray4.foreground,
Scr.d_depth ));
}
}
else{
XSetWindowBackgroundPixmap( dpy, win,
@ -902,26 +916,26 @@ void DrawResizeBox( MlvwmWindow *t, Bool on_off )
if( Scr.flags&SYSTEM8 ){
for(lp=0; lp<3; lp++ ){
XDrawLine( dpy, t->resize_b, Scr.WhiteGC,
2+lp*3, 9+lp*3, 8+lp*3, 3+lp*3 );
3+lp*2, 8+lp*2, 7+lp*2, 4+lp*2 );
XDrawLine( dpy, t->resize_b, Scr.BlackGC,
4+lp*3, 8+lp*3, 9+lp*3, 3+lp*3 );
4+lp*2, 8+lp*2, 8+lp*2, 4+lp*2 );
}
}
else{
point = 6*SBAR_WH/19.+0.5;
scale = 9*SBAR_WH/19.+0.5;
point = 4*SBAR_WH/16.;
scale = 9*SBAR_WH/16.;
DrawShadowBox( point, point, scale, scale, t->resize_b,
1, Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
DrawShadowBox( point-1, point-1, scale+2, scale+2, t->resize_b,
1, Scr.BlackGC, Scr.WhiteGC, SHADOW_ALL );
point = 3*SBAR_WH/19.+0.5;
scale = 8*SBAR_WH/19.+0.5;
point = 3*SBAR_WH/16.;
scale = 6*SBAR_WH/16.;
XFillRectangle( dpy, t->resize_b, Scr.Gray4GC,
point, point, scale, scale );
point = 4*SBAR_WH/19.+0.5;
scale = 7*SBAR_WH/19.+0.5;
point = 3*SBAR_WH/16.;
scale = 5*SBAR_WH/16.;
DrawShadowBox( point, point, scale, scale, t->resize_b,
1, Scr.WhiteGC, Scr.BlackGC, SHADOW_ALL );
DrawShadowBox( point-1, point-1, scale+2, scale+2, t->resize_b,
@ -966,6 +980,7 @@ void DrawAllDecorations( MlvwmWindow *t, Bool on_off )
void SetFocus( MlvwmWindow *t )
{
char *str, action[24], *winname;
size_t str_size;
unsigned long mask, valuemask;
XSetWindowAttributes attributes;
XGCValues xgcv;
@ -1016,8 +1031,9 @@ void SetFocus( MlvwmWindow *t )
ChangeMenuLabel( &(Scr.IconMenu), NULL,
t->miniicon==NULL?Scr.SystemIcon:t->miniicon );
if( !(t->flags&TRANSIENT) ){
str = calloc( strlen(t->name)+6, 1 );
sprintf( str, "Hide %s", t->name );
str_size = strlen(t->name)+6;
str = calloc( str_size, 1 );
snprintf( str, str_size, "Hide %s", t->name );
ChangeMenuItemLabel( "ICON", Scr.IconMenu.m_item->label,
str, NULL, SELECTON, M_COPY );
ChangeMenuItemLabel( "ICON", "Hide Others", "Hide Others",

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */
@ -17,7 +17,7 @@
extern void SetShape( MlvwmWindow *, int );
extern void SetUpFrame( MlvwmWindow *, int, int, int, int, Bool );
extern void SetTitleBar( MlvwmWindow *, Bool );
extern void DrawArrow( Window, int, GC );
extern void DrawArrow( Window, int, GC, GC );
extern void DrawSbarAnk( MlvwmWindow *, int, Bool );
extern void DrawSbarArrow( MlvwmWindow *, int, Bool );
extern void DrawSbarBar( MlvwmWindow *, int, Bool );

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is mostly all new */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996 TakaC Hasegawa. No restrictions are placed on this code, */
/* as long as the copyright notice is preserved */
/****************************************************************************/
@ -431,6 +431,11 @@ void SetSloppyFocus( char *line, FILE *fp )
Scr.flags |= SLOPPYFOCUS;
}
void SetSwallowFocusClick( char *line, FILE *fp )
{
Scr.flags |= SWALLOWFOCUSCLICK;
}
void SetStickyHide( char *line, FILE *fp )
{
Scr.flags |= STICKHIDE;
@ -713,6 +718,11 @@ void SetEdgeResist( char *line, FILE *fp )
}
}
void SetRoundedCorners( char *line, FILE *fp )
{
Scr.flags |= ROUNDEDCORNERS;
}
config_func main_config[]={
{ "Desktopnum", SetDeskTopNum },
{ "DoubleClickTime", SetDoubleClickTime },
@ -734,6 +744,7 @@ config_func main_config[]={
{ "Menu", SetMenu},
{ "Read", ReadNewConfigFile },
{ "RestartPreviousState", SetRstPrevState },
{ "RoundedScreenCorners", SetRoundedCorners },
{ "ScrollBarWidth", SetBarWidth },
{ "ShadeMap", SetShadeMap },
{ "ShortCut", SetShortCut },
@ -742,6 +753,7 @@ config_func main_config[]={
{ "StickyHide", SetStickyHide },
{ "Style", SetStyles },
{ "Swallow", SetSwallow },
{ "SwallowFocusClick", SetSwallowFocusClick },
{ "System8", SetSystem8 },
{ "OpaqueMove", SetOpaqueMove },
{ "OpaqueResize", SetOpaqueResize },
@ -757,10 +769,12 @@ config_func main_config[]={
void ReadConfigFile( char *configfile )
{
FILE *fp;
char str[1024], *file, *cmp;
char str[1024], cmp[1024], *file, *str_start, *cmp_end;
int lp;
size_t len;
#ifdef MLVWMLIBDIR
char *sysrc;
size_t sysrc_size;
#endif
if( (file = LookUpFiles( NULL, configfile, R_OK ))==NULL )
@ -768,12 +782,14 @@ void ReadConfigFile( char *configfile )
#ifdef MLVWMLIBDIR
if( !file ){
if( strcmp( configfile, CONFIGNAME) ){
sysrc = calloc( strlen(MLVWMLIBDIR)+strlen(configfile)+2, 1 );
sprintf( sysrc, "%s/%s", MLVWMLIBDIR, configfile );
sysrc_size = strlen(MLVWMLIBDIR)+strlen(configfile)+2;
sysrc = calloc( sysrc_size, 1 );
snprintf( sysrc, sysrc_size, "%s/%s", MLVWMLIBDIR, configfile );
}
else{
sysrc = calloc( strlen(MLVWMLIBDIR)+strlen(configfile)+9, 1 );
sprintf( sysrc, "%s/system%s", MLVWMLIBDIR, configfile );
sysrc_size = strlen(MLVWMLIBDIR)+strlen(configfile)+9;
sysrc = calloc( sysrc_size, 1 );
snprintf( sysrc, sysrc_size, "%s/system%s", MLVWMLIBDIR, configfile );
}
file = LookUpFiles( NULL, sysrc, R_OK );
free( sysrc );
@ -787,14 +803,21 @@ void ReadConfigFile( char *configfile )
while( fgetline( str, sizeof(str), fp )!=NULL ){
if( Scr.flags & DEBUGOUT )
DrawStringMenuBar( str );
cmp = str;
if( *cmp == '#' ) continue;
cmp = SkipSpace( cmp );
if( *cmp == '\n' ) continue;
str_start = str;
if( *str_start == '#' ) continue;
str_start = SkipSpace( str_start );
if( *str_start == '\n' ) continue;
snprintf( cmp, sizeof(cmp), "%s", str_start );
cmp_end = SkipNonSpace( cmp );
*cmp_end = '\0';
for( lp=0; main_config[lp].label!=NULL; lp++ ){
if( !strncmp( cmp, main_config[lp].label,
strlen(main_config[lp].label) )){
len = strlen(cmp);
if( strlen(main_config[lp].label) > len )
len = strlen(main_config[lp].label);
if( !strncmp( cmp, main_config[lp].label, len )){
main_config[lp].action( str, fp );
break;
}

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */
@ -44,6 +44,7 @@ struct configure
extern void SetDeskTopNum( char *, FILE * );
extern void SetFollowToMouse( char *, FILE * );
extern void SetSwallowFocusClick( char *, FILE * );
extern void ReadConfigFile( char * );
extern void FreeStyles( void );

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is based on fvwm, but has been siginificantly modified */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/****************************************************************************/
/****************************************************************************
* This module is based on Twm, but has been siginificantly modified
@ -383,7 +383,7 @@ void handle_configure_request( XEvent *ev )
unsigned long xwcm;
MlvwmWindow *tmp_win;
XConfigureRequestEvent *xcr = &ev->xconfigurerequest;
int x, y, width, height, old_x, old_y;
int x, y, width, height;
int title_height, sbar_v, sbar_h;
Bool notify=False;
@ -418,8 +418,6 @@ void handle_configure_request( XEvent *ev )
x = tmp_win->frame_x;
y = tmp_win->frame_y;
old_x = x;
old_y = y;
width = tmp_win->frame_w;
height = tmp_win->frame_h;
@ -441,24 +439,21 @@ void handle_configure_request( XEvent *ev )
if (xcr->value_mask & CWWidth) width = xcr->width+12;
if (xcr->value_mask & CWHeight) height = xcr->height+12;
}
/*
tmp_win->frame_x = x<0 ? 0 : x;
tmp_win->frame_y = y<MENUB_H ? MENUB_H : y;
*/
tmp_win->win_w = width;
tmp_win->win_h = height;
if( old_x!=x || old_y!=y ) notify = True;
// prevent windows from being moved above menu bar
if (y < MENUB_H)
y = MENUB_H;
if( tmp_win->frame_x!=x || tmp_win->frame_y!=y ) notify = True;
if( !(tmp_win->flags&SCROLL) ||
tmp_win->frame_w>tmp_win->win_w || !(tmp_win->flags&SBARH) )
tmp_win->frame_w = tmp_win->win_w;
width>tmp_win->win_w || !(tmp_win->flags&SBARH) )
width = tmp_win->win_w;
if( !(tmp_win->flags&SCROLL) ||
tmp_win->frame_h>tmp_win->win_h || !(tmp_win->flags&SBARV) )
tmp_win->frame_h = tmp_win->win_h;
height>tmp_win->win_h || !(tmp_win->flags&SBARV) )
height = tmp_win->win_h;
SetUpFrame(tmp_win, tmp_win->frame_x, tmp_win->frame_y,
tmp_win->frame_w, tmp_win->frame_h, notify );
SetUpFrame(tmp_win, x, y, width, height, notify );
if( tmp_win==Scr.ActiveWin ){
Scr.ActiveWin = NULL;
@ -969,7 +964,7 @@ void MinMaxWindow( MlvwmWindow *mw, XEvent *evp )
DisplayPush( mw->minmax_b );
XDrawRectangle( dpy, mw->minmax_b, Scr.BlackGC,
1, 1, BOXSIZE-6, BOXSIZE-6 );
1, 1, BOXSIZE-7, BOXSIZE-7 );
while( !isEnd ){
XMaskEvent( dpy,
ButtonReleaseMask|EnterWindowMask|LeaveWindowMask, &ev );
@ -983,7 +978,7 @@ void MinMaxWindow( MlvwmWindow *mw, XEvent *evp )
if( ev.xcrossing.window==mw->minmax_b ){
DisplayPush( mw->minmax_b );
XDrawRectangle( dpy, mw->minmax_b, Scr.BlackGC,
1, 1, BOXSIZE-6, BOXSIZE-6 );
1, 1, BOXSIZE-6, BOXSIZE-6 );
isIn = True;
}
break;
@ -1248,7 +1243,10 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
anker = tmp_win->scroll_v[3];
}
if( pushd!=0 ){
DrawArrow( pressedwin, direction, Scr.BlackGC );
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
XSync( dpy, 0 );
}
@ -1289,15 +1287,23 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
break;
case EnterNotify:
if( ev.xcrossing.window==pressedwin ){
if( !isSelect )
DrawArrow( pressedwin, direction, Scr.BlackGC );
if( !isSelect ) {
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.Gray2GC, Scr.WhiteGC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.BlackGC, Scr.BlackGC );
}
isSelect = True;
}
break;
case LeaveNotify:
if( ev.xcrossing.window==pressedwin ){
if( isSelect )
DrawArrow( pressedwin, direction, Scr.Gray3GC );
if( isSelect ) {
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
}
isSelect = False;
}
break;
@ -1329,8 +1335,12 @@ void PressSbar( Bool isHbar, Window pressedwin, MlvwmWindow *tmp_win )
}
while( !isEnd );
if( pushd!=0 )
DrawArrow( pressedwin, direction, Scr.Gray3GC );
if( pushd!=0 ) {
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, SBAR_WH, SBAR_WH, pressedwin, 1, Scr.WhiteGC, Scr.Gray2GC, SHADOW_ALL );
else
DrawArrow( pressedwin, direction, Scr.Gray3GC, Scr.BlackGC );
}
XSync( dpy, 0 );
}
@ -1374,7 +1384,11 @@ void handle_button_press( XEvent *ev )
ev->xany.window = ev->xbutton.subwindow;
context = GetContext( Tmp_win, ev, &win );
}
XAllowEvents(dpy, AsyncPointer, CurrentTime );
if ( context==C_TITLE || Scr.flags&SWALLOWFOCUSCLICK )
XAllowEvents(dpy, AsyncPointer, CurrentTime );
else {
XAllowEvents(dpy, ReplayPointer, CurrentTime );
}
}
else
XAllowEvents(dpy, ReplayPointer, CurrentTime );
@ -1596,6 +1610,7 @@ void handle_property_request( XEvent *ev )
XTextProperty text_prop;
unsigned int JunkWidth, JunkHeight, JunkBW, JunkDepth;
char desk[8], *str, action[24];
size_t str_size;
#ifdef USE_LOCALE
int num;
char **list;
@ -1640,8 +1655,9 @@ void handle_property_request( XEvent *ev )
ChangeMenuItemLabel( "ICON", oldWinName, winname,
action, M_ALLSET, M_AND );
if( tmp_win==Scr.ActiveWin ){
str = calloc( strlen( tmp_win->name )+6, 1 );
sprintf( str, "Hide %s", tmp_win->name );
str_size = strlen(tmp_win->name)+6;
str = calloc( str_size, 1 );
snprintf( str, str_size, "Hide %s", tmp_win->name );
ChangeMenuItemLabel( "ICON", Scr.IconMenu.m_item->label,
str, NULL, SELECTON, M_COPY );
free( str );

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */
@ -674,7 +674,7 @@ void RestartSystem( char *action )
top = SkipSpace( SkipNonSpace( action+6 ));
if( strncmp( top, "mlvwm", 5 ) )
Done( 1, top );
Done( 1, strdup(top) );
else
Done( 1, NULL );
}

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */
@ -120,27 +120,30 @@ void RedrawMenuBar( void )
if( Scr.flags&SYSTEM8 )
DrawShadowBox( 0, 0, Scr.MyDisplayWidth, MENUB_H, Scr.MenuBar, 1,
Scr.WhiteGC, Scr.Gray1GC, SHADOW_ALL );
XFillRectangle( dpy, Scr.MenuBar, Scr.BlackGC, 0, 0, 7, 7 );
XFillRectangle( dpy, Scr.MenuBar,
Scr.BlackGC, Scr.MyDisplayWidth-7, 0, 7, 7 );
if( Scr.flags&SYSTEM8 && !(Scr.flags&STARTING) ){
for( lp=0; lp<2; lp++ ){
XDrawArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0,
14-lp, 14-lp, 180*64, -(90*64) );
XDrawArc( dpy, Scr.MenuBar, Scr.Gray1GC, Scr.MyDisplayWidth-15, 0,
14-lp, 14-lp, 0, 90*64 );
}
XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, 0, 0,
14, 14, 180*64, -(90*64) );
XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, Scr.MyDisplayWidth-15, 0,
14, 14, 0, 90*64 );
}
else{
XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0,
14, 14, 180*64, -(90*64) );
XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, Scr.MyDisplayWidth-15, 0,
14, 14, 0, 90*64 );
}
if(Scr.flags&ROUNDEDCORNERS){
XFillRectangle( dpy, Scr.MenuBar, Scr.BlackGC, 0, 0, 7, 7 );
XFillRectangle( dpy, Scr.MenuBar,
Scr.BlackGC, Scr.MyDisplayWidth-7, 0, 7, 7 );
if( Scr.flags&SYSTEM8 && !(Scr.flags&STARTING) ){
XDrawArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0,
14, 14, 180*64, -(90*64) );
XDrawArc( dpy, Scr.MenuBar, Scr.Gray1GC, Scr.MyDisplayWidth-15, 0,
14, 14, 0, 90*64 );
XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, 0, 0,
14, 14, 180*64, -(90*64) );
XFillArc( dpy, Scr.MenuBar, Scr.MenuBlueGC, Scr.MyDisplayWidth-15, 0,
14, 14, 0, 90*64 );
}
else{
XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, 0, 0,
14, 14, 180*64, -(90*64) );
XFillArc( dpy, Scr.MenuBar, Scr.WhiteGC, Scr.MyDisplayWidth-15, 0,
14, 14, 0, 90*64 );
}
XMapWindow( dpy, Scr.lbCorner );
XMapWindow( dpy, Scr.rbCorner );
}
if( !(Scr.flags&SYSTEM8) )
XDrawLine( dpy, Scr.MenuBar, Scr.BlackGC,
0, MENUB_H-1, Scr.MyDisplayWidth, MENUB_H-1 );
@ -411,19 +414,19 @@ Bool MapMenu( MenuLabel *m, int left, int right, int y, Bool side )
XMoveResizeWindow( dpy, m->PullWin, m->MenuX, m->MenuY,
m->MenuWidth+2, m->MenuHeight+2 );
{
XRectangle rect[7];
XRectangle rect[5];
int point=0;
rect[point].x = -1; rect[point].y = -1;
rect[point].width = m->MenuWidth+1;
rect[point].height = m->MenuHeight+1;
point++;
for( lp=1; lp<4; lp++ ){
for( lp=1; lp<3; lp++ ){
rect[point].x = m->MenuWidth+lp-1; rect[point].y = lp-1;
rect[point].width = 1; rect[point].height = m->MenuHeight+2-lp+1;
point++;
}
for( lp=1; lp<4; lp++ ){
for( lp=1; lp<3; lp++ ){
rect[point].x = lp-1; rect[point].y = m->MenuHeight+lp-1;
rect[point].width = m->MenuWidth+2-lp+1; rect[point].height = 1;
point++;
@ -1293,30 +1296,26 @@ Window PixmapWin (char **data_xpm, Window root, int x, int y)
void CreateMenuBar( void )
{
static char *lbot_xpm[] = {
"7 7 2 1",
" c none s none",
"# c black",
"# ",
"# ",
"# ",
"## ",
"### ",
"#### ",
"#######"
};
static char *rbot_xpm[] = {
"7 7 2 1",
" c none s none",
"# c black",
" #",
" #",
" #",
" ##",
" ###",
" ####",
"#######"
};
static char *lbot_xpm[] = {
"5 5 2 1",
" c none s none",
"# c black",
"# ",
"# ",
"## ",
"### ",
"#####"
};
static char *rbot_xpm[] = {
"5 5 2 1",
" c none s none",
"# c black",
" #",
" #",
" ##",
" ###",
"#####"
};
unsigned long valuemask;
XSetWindowAttributes attributes;
@ -1331,11 +1330,9 @@ void CreateMenuBar( void )
CopyFromParent, InputOutput, CopyFromParent,
valuemask, &attributes );
XMapWindow( dpy, Scr.MenuBar );
Scr.lbCorner = PixmapWin( lbot_xpm, Scr.Root, 0, -1 );
XMapWindow( dpy, Scr.lbCorner );
Scr.lbCorner = PixmapWin( lbot_xpm, Scr.Root, 0, -1 );
Scr.rbCorner = PixmapWin( rbot_xpm, Scr.Root, -1, -1 );
Scr.rbCorner = PixmapWin( rbot_xpm, Scr.Root, -1, -1 );
XMapWindow( dpy, Scr.rbCorner );
RedrawMenuBar( );
}

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */
@ -12,7 +12,7 @@
#include <X11/Xutil.h>
#include <X11/xpm.h>
#define MENUB_H 25
#define MENUB_H 20
/* Definitions of Menu Item */
#define STRGRAY 1 /* Draw String Black or Gray? */

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is mostly all new */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996 TakaC Hasegawa. No restrictions are placed on this code, */
/* as long as the copyright notice is preserved */
/****************************************************************************/
@ -43,7 +43,8 @@ char *fgetline( char *str, int size, FILE *fp )
char *LookUpFiles( char *path, char *filename, int mode )
{
char *find;
char *find, *separator;
size_t find_size;
if( !access( filename, mode ) ){
find = strdup( filename );
@ -52,14 +53,16 @@ char *LookUpFiles( char *path, char *filename, int mode )
if( path==NULL ) return NULL;
do{
path=SkipSpace( path );
find = calloc( strlen(path)+strlen(filename)+2, 1 );
find_size = strlen(path)+strlen(filename)+2;
find = calloc( find_size, 1 );
if( strchr( path, ':' )==NULL ){
sprintf( find, "%s/%s", path, filename );
snprintf( find, find_size, "%s/%s", path, filename );
path += strlen( path );
}
else{
strcpy( find, path );
sprintf( strchr( find, ':' ), "/%s", filename );
separator = strchr( find, ':' );
snprintf( separator, strlen(separator)+strlen(filename)+2, "/%s", filename );
path = strchr( path, ':') + 1;
}
if( !access(find, mode ) ){
@ -73,7 +76,7 @@ char *LookUpFiles( char *path, char *filename, int mode )
char *SkipNonSpace( char *str )
{
for( ; *str!=' ' && *str!='\t' && *str; str++ );
for( ; *str!=' ' && *str!='\t' && *str!='\n' && *str; str++ );
return str;
}
@ -120,12 +123,14 @@ void sleep_a_little(int n)
void DrawErrMsgOnMenu( char *str1, char *str2 )
{
char *str;
size_t str_size;
static int call=0;
int wait_s;
call++;
str = calloc( strlen(str1)+strlen(str2)+1, 1 );
sprintf( str, "%s%s", str1, str2 );
str_size = strlen(str1)+strlen(str2)+1;
str = calloc( str_size, 1 );
snprintf( str, str_size, "%s%s", str1, str2 );
if( call<5 ) XBell( dpy, 30 );
DrawStringMenuBar( str );
wait_s = 3000000-call/5*500000;
@ -274,13 +279,15 @@ void RaiseMlvwmWindow( MlvwmWindow *win )
char *WinListName( MlvwmWindow *mw )
{
char *winname;
size_t winname_size;
winname = calloc( strlen( mw->name )+1+(Scr.flags&DISPDESK?3:0), 1 );
winname_size = strlen( mw->name )+1+(Scr.flags&DISPDESK?3:0);
winname = calloc( winname_size, 1 );
if( Scr.flags&DISPDESK ){
if( mw->flags&STICKY )
sprintf( winname, "S:%s", mw->name );
snprintf( winname, winname_size, "S:%s", mw->name );
else
sprintf( winname, "%d:%s", mw->Desk, mw->name );
snprintf( winname, winname_size, "%d:%s", mw->Desk, mw->name );
}
else
strcpy( winname, mw->name );

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is based on fvwm, but has been siginificantly modified */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/****************************************************************************/
/****************************************************************************
* This module is based on Twm, but has been siginificantly modified
@ -186,10 +186,7 @@ void InitScrParams( void )
Scr.style_list = NULL;
Scr.ShortCutRoot = NULL;
Scr.double_click_time = 300;
if( Scr.flags&SYSTEM8 )
Scr.bar_width = 16;
else
Scr.bar_width = 19;
Scr.bar_width = 16;
Scr.flush_time = 100000;
Scr.flush_times = 2;
Scr.zoom_wait = 10000;
@ -545,10 +542,11 @@ void DoStartFunc( void )
int main( int argc, char *argv[] )
{
char *display_name=NULL;
char *display_screen;
char *display_string;
char *config_file=NULL;
char message[255];
char num[10];
char *cp;
Window StartWin;
XSetWindowAttributes attributes;
int len, lp;
@ -614,26 +612,36 @@ int main( int argc, char *argv[] )
if(!single){
for(lp=0;lp<Scr.NumberOfScreens;lp++){
if(lp!= Scr.screen){
sprintf(message,"%s -d %s",argv[0],XDisplayString(dpy));
len = strlen(message);
message[len-1] = '\0';
sprintf(num,"%d",lp);
strcat(message,num);
strcat(message," -s ");
len = strlen(XDisplayString(dpy)) + 10;
display_screen = calloc(len, sizeof(char));
snprintf(display_screen, len, "%s", XDisplayString(dpy));
/*
* Truncate the string 'whatever:n.n' to 'whatever:n',
* and then append the screen number.
*/
cp = strchr(display_screen, ':');
if (cp != NULL)
{
cp = strchr(cp, '.');
if (cp != NULL)
*cp = '\0'; /* truncate at display part */
}
snprintf(message, sizeof(message), "%s -d %s.%d -s", argv[0], display_screen, lp);
free(display_screen);
if( Scr.flags & DEBUGOUT)
strcat(message," -debug");
if( config_file!=NULL ){
strcat(message," -f ");
strcat(message,config_file);
}
strcat(message," &\n");
snprintf(message + strlen(message), sizeof(message) - strlen(message), " -debug");
if( config_file != NULL )
snprintf(message + strlen(message), sizeof(message) - strlen(message) ," -f %s", config_file);
snprintf(message + strlen(message), sizeof(message) - strlen(message), " &\n");
system(message);
}
}
}
len = strlen( XDisplayString( dpy ) );
display_string = calloc( len+10, sizeof( char ) );
sprintf( display_string, "DISPLAY=%s", XDisplayString( dpy ) );
snprintf( display_string, len+10, "DISPLAY=%s", XDisplayString(dpy) );
putenv( display_string );
XShapeQueryExtension( dpy, &ShapeEventBase, &ShapeErrorBase );

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is based on fvwm, but has been siginificantly modified */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp) */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/****************************************************************************/
/****************************************************************************
* This module is based on Twm, but has been siginificantly modified
@ -34,7 +34,7 @@
/*****************************************************************************/
#ifndef _MLVWM_
#define _MLVFM_
#define _MLVWM_
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@ -57,8 +57,8 @@
#define ReapChildren() while ((wait3(NULL, WNOHANG, NULL)) > 0);
#endif
#define TITLE_HEIGHT 20
#define BOXSIZE 13
#define TITLE_HEIGHT (Scr.flags&SYSTEM8?20:17)
#define BOXSIZE (Scr.flags&SYSTEM8?13:11)
#define SBAR_WH Scr.bar_width
extern Display *dpy;
@ -178,9 +178,9 @@ extern Atom _XA_WM_DESKTOP;
extern void Done( int, char * );
#ifdef USE_LOCALE
#define DEFAULTFS "-adobe-*-*-r-*-*-14-*-*-*-p-*-*-*,\
-*-*-*-r-*-*-14-*-*-*-*-*-*-*"
#define DEFAULTFS "-adobe-*-*-r-*-*-12-*-*-*-p-*-*-*,\
-*-*-*-r-*-*-12-*-*-*-*-*-*-*"
#else
#define DEFAULTFONT "-adobe-*-*-r-*-*-14-*-*-*-p-*-*-*"
#define DEFAULTFONT "-adobe-*-*-r-*-*-12-*-*-*-p-*-*-*"
#endif
#endif

View File

@ -141,6 +141,8 @@ typedef struct ScreenInfo
#define OPAQUERESIZE 0x00008000
#define ONECLICKMENU 0x00010000
#define DEBUGOUT 0x00020000
#define ROUNDEDCORNERS 0x00040000
#define SWALLOWFOCUSCLICK 0x00080000
#ifdef USE_LOCALE
#define MENUBARFONT Scr.MenuBarFs

View File

@ -1,4 +1,5 @@
#include <stdio.h>
#include <string.h>
#ifndef TRUE
#define TRUE 1

View File

@ -1,6 +1,6 @@
/****************************************************************************/
/* This module is all original code */
/* by TakaC Hasegawa (tak@bioele.nuee.nagoya-u.ac.jp */
/* by TakaC Hasegawa (tac.hasegawa@gmail.com) */
/* Copyright 1996, TakaC Hasegawa */
/* You may use this code for any purpose, as long as the original */
/* copyright remains in the source code and all documentation */