Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 18699
Collapse All | Expand All

(-)fluxbox-0.1.14/autogen.sh (+10 lines)
Line 0 Link Here
1
#!/bin/sh
2
libtoolize --copy --force --automake
3
rm -f config.cache
4
aclocal
5
autoheader
6
automake -a
7
autoconf
8
echo "Done."
9
10
(-)fluxbox-0.1.14/doc/fluxbox.1.in (+69 lines)
Lines 323-328 Link Here
323
An
323
An
324
.B [end]
324
.B [end]
325
tag is required to end the submenu.
325
tag is required to end the submenu.
326
.IP
327
If you create a submenu labelled 'Startup', applications located in this
328
submenu will be launched on fluxbox startup.
326
.TP
329
.TP
327
.B [reconfig] (label)
330
.B [reconfig] (label)
328
When selected, this item rereads the current style and menu files and
331
When selected, this item rereads the current style and menu files and
Lines 375-380 Link Here
375
    [exec] (edit) {mozilla -edit}
378
    [exec] (edit) {mozilla -edit}
376
    [exec] (compose) {mozilla -compose}
379
    [exec] (compose) {mozilla -compose}
377
  [end]
380
  [end]
381
  [submenu] (Startup)
382
    [exec] (gkrellm) {gkrellm -w}
383
    [exec] (xmms) {xmms -p}
384
    [exec] (galeon) {galeon -s}
385
    [exec] (kdeinit) {kdeinit}
386
  [end]
378
  [submenu] (Window Manager)
387
  [submenu] (Window Manager)
379
    [exec] (Edit Menus) {nedit ~/.fluxbox/menu}
388
    [exec] (Edit Menus) {nedit ~/.fluxbox/menu}
380
    [submenu] (Style) {Which Style?}
389
    [submenu] (Style) {Which Style?}
Lines 1069-1074 Link Here
1069
This way the main workspace (screen0) has the maximum amount of space available
1078
This way the main workspace (screen0) has the maximum amount of space available
1070
and the secondary workspace could show the time and run some withrawn apps like
1079
and the secondary workspace could show the time and run some withrawn apps like
1071
gkrellm in the slit, always visible yet out of the way of real work.
1080
gkrellm in the slit, always visible yet out of the way of real work.
1081
.SH APPLICATIONS SETTINGS
1082
Sometimes, you want to force an application to have always the same dimensions,
1083
position, and other settings.  It is now possible with the new window-submenu
1084
called 'Remember...'.  Settings are saved in the
1085
.I ~/.fluxbox/apps
1086
file.  You don't have to edit the file yourself as all manipulations can be
1087
done using the 'Remember...' submenu.
1088
.TP
1089
.B Workspace [0-N]
1090
Force the workspace of the application to be the current one, even if you launch
1091
the application from another workspace.
1092
.TP
1093
.B Dimensions [Width Height]
1094
Remember the current dimensions.
1095
.TP
1096
.B Position [X Y]
1097
Remember the current position.
1098
.TP
1099
.B Shaded state [yes|no]
1100
Remember the current shaded state.
1101
.TP
1102
.B Tab state [yes|no]
1103
Remember the current tab state.
1104
.TP
1105
.B Decoration state [NONE|NORMAL|TOOL|TINY]
1106
Remember the current decoration state.
1107
.TP
1108
.B Sticky state [yes|no]
1109
Remember the current sticky state.
1110
.TP
1111
.B Jump to workspace [yes|no]
1112
This one is only useful if 'Workspace' is set too.  The workspace is changed
1113
to the workspace containing the application being launched.
1114
.TP
1115
.B Save settings on close [yes|no]
1116
By default, application settings are not saved when a window is closed.  Set
1117
this option if you want previous settings to be saved when the window is closed.
1118
.SS Applications example
1119
Here is a short example of an apps file:
1120
.PP
1121
.nf
1122
[app] (kate)
1123
  [Dimensions]  {1022 747}
1124
  [Position]    {0 0}
1125
  [Close]       {yes}
1126
[end]
1127
[app] (konqueror)
1128
  [Workspace]   {1}
1129
  [Dimensions]  {1006 749}
1130
  [Position]    {16 0}
1131
  [Jump]        {yes}
1132
[end]
1133
[app] (xterm)
1134
  [Deco]        {NONE}
1135
[end]
1136
.fi
1137
1138
Parameters in the 'apps' file are case-sensitive.  Application names are taken
1139
from the first X-Window WM_CLASS attribute.  You can see this attribute by using
1140
the xprop command.  Transient windows are not affected by application settings.
1072
.SH ENVIRONMENT
1141
.SH ENVIRONMENT
1073
.TP
1142
.TP
1074
.B HOME
1143
.B HOME
(-)fluxbox-0.1.14/nls/C/Windowmenu.m (+20 lines)
Lines 22-24 Link Here
22
# Close
22
# Close
23
$ #Tab
23
$ #Tab
24
# Tab
24
# Tab
25
$ #Remember
26
# Remember ...
27
$ #RememberWorkspace
28
# Workspace
29
$ #RememberDimensions
30
# Dimensions
31
$ #RememberPosition
32
# Position
33
$ #RememberShaded
34
# Shaded state
35
$ #RememberTab
36
# Tab state
37
$ #RememberDeco
38
# Decoration state
39
$ #RememberSticky
40
# Sticky state
41
$ #RememberJump
42
# Jump to Workspace
43
$ #RememberSave
44
# Save settings on close
(-)fluxbox-0.1.14/nls/blackbox-nls.hh (+10 lines)
Lines 124-129 Link Here
124
	WindowmenuKillClient = 0x9,
124
	WindowmenuKillClient = 0x9,
125
	WindowmenuClose = 0xa,
125
	WindowmenuClose = 0xa,
126
	WindowmenuTab = 0xb,
126
	WindowmenuTab = 0xb,
127
	WindowmenuRemember = 0xc,
128
	WindowmenuRememberWorkspace = 0xd,
129
	WindowmenuRememberDimensions = 0xe,
130
	WindowmenuRememberPosition = 0xf,
131
	WindowmenuRememberShaded = 0x10,
132
	WindowmenuRememberTab = 0x11,
133
	WindowmenuRememberDeco = 0x12,
134
	WindowmenuRememberSticky = 0x13,
135
	WindowmenuRememberJump = 0x14,
136
	WindowmenuRememberSave = 0x15,
127
137
128
	WorkspaceSet = 0xb,
138
	WorkspaceSet = 0xb,
129
	WorkspaceDefaultNameFormat = 0x1,
139
	WorkspaceDefaultNameFormat = 0x1,
(-)fluxbox-0.1.14/nls/fr_FR/Windowmenu.m (+20 lines)
Lines 22-24 Link Here
22
# Fermer
22
# Fermer
23
$ #Tab
23
$ #Tab
24
# Onglet
24
# Onglet
25
$ #Remember
26
# Retenir ...
27
$ #RememberWorkspace
28
# Bureau
29
$ #RememberDimensions
30
# Dimensions
31
$ #RememberPosition
32
# Position
33
$ #RememberShaded
34
# Etat ombré
35
$ #RememberTab
36
# Etat de l'onglet
37
$ #RememberDeco
38
# Etat des décorations
39
$ #RememberSticky
40
# Etat collant
41
$ #RememberJump
42
# Aller au bureau
43
$ #RememberSave
44
# Sauver les paramètres à la fermeture
(-)fluxbox-0.1.14/src/Application.cc (+227 lines)
Line 0 Link Here
1
// Application.cc for Fluxbox Window Manager
2
// Copyright (c) 2002 Xavier Brouckaert
3
//
4
// Permission is hereby granted, free of charge, to any person obtaining a
5
// copy of this software and associated documentation files (the "Software"),
6
// to deal in the Software without restriction, including without limitation
7
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
// and/or sell copies of the Software, and to permit persons to whom the
9
// Software is furnished to do so, subject to the following conditions:
10
//
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
13
//
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
// DEALINGS IN THE SOFTWARE.
21
22
//use GNU extensions
23
#ifndef	 _GNU_SOURCE
24
#define	 _GNU_SOURCE
25
#endif // _GNU_SOURCE
26
27
#include <iostream>
28
#include <string>
29
#include <memory>
30
#include <sstream>
31
#include <fstream>
32
#include <stdio.h>
33
34
#include "Application.hh"
35
#include "fluxbox.hh"
36
37
#ifndef    MAXPATHLEN
38
#define    MAXPATHLEN 255
39
#endif // MAXPATHLEN
40
41
Application::Application() {
42
	workspace_remember =
43
	dimensions_remember =
44
	position_remember =
45
	stuckstate_remember =
46
	decostate_remember =
47
	shadedstate_remember =
48
	tabstate_remember =
49
	jumpworkspace_remember =
50
	save_on_close_remember = false;
51
}
52
53
Applications::Applications() {
54
	load();
55
}
56
57
Application* Applications::add(char* app_name) {
58
	if (!app_name)
59
		return NULL;
60
	Application* a = new Application();
61
	apps[app_name] = a;
62
	return a;
63
}
64
65
Application* Applications::find(char* app_name) {
66
	if (!app_name)
67
		return NULL;
68
	Apps::iterator i = apps.find(app_name);
69
	if (i!=apps.end())
70
		return i->second;
71
	else
72
		return NULL;
73
}
74
75
void Applications::parseApp(ifstream &file, Application *a) {
76
	string line;
77
	
78
	while (! file.eof()) {
79
		if (getline(file, line)) {
80
			if (line[0] != '#') { //the line is commented
81
				int parse_pos = 0, err = 0;
82
				std::string str_key, str_label;
83
				err = StringUtil::getStringBetween(str_key, line.c_str(), '[', ']');
84
				if (err > 0 ) {
85
					parse_pos += err;
86
					err = StringUtil::getStringBetween(str_label, line.c_str() + parse_pos, '{', '}');
87
					if (err>0) {
88
						parse_pos += err;
89
					}
90
				} else
91
					continue; //read next line
92
				if (!str_key.size())
93
					continue; //read next line
94
				if (str_key == "Workspace") {
95
					unsigned int w;
96
					istringstream iss(str_label.c_str());
97
					iss >> w;
98
					a->rememberWorkspace(w);
99
				} else if (str_key == "Dimensions") {
100
					unsigned int h,w;
101
					istringstream iss(str_label.c_str());
102
					iss >> w >> h;
103
					a->rememberDimensions(w,h);
104
				} else if (str_key == "Position") {
105
					unsigned int x,y;
106
					istringstream iss(str_label);
107
					iss >> x >> y;
108
					a->rememberPosition(x,y);
109
				} else if (str_key == "Shaded") {
110
					a->rememberShadedstate((str_label=="yes"));
111
				} else if (str_key == "Tab") {
112
					a->rememberTabstate((str_label=="yes"));
113
				} else if (str_key == "Deco") {
114
					if (str_label == "NONE") {
115
						a->rememberDecostate(FluxboxWindow::DECOR_NONE);
116
					} else if (str_label == "NORMAL") {
117
						a->rememberDecostate(FluxboxWindow::DECOR_NORMAL);
118
					} else if (str_label == "TINY") {
119
						a->rememberDecostate(FluxboxWindow::DECOR_TINY);
120
					} else if (str_label == "TOOL") {
121
						a->rememberDecostate(FluxboxWindow::DECOR_TOOL);
122
					}
123
				} else if (str_key == "Sticky") {
124
					a->rememberStuckstate((str_label=="yes"));
125
				} else if (str_key == "Jump") {
126
					a->rememberJumpworkspace((str_label=="yes"));
127
				} else if (str_key == "Close") {
128
					a->rememberSave((str_label=="yes"));
129
				} else if (str_key == "end") {
130
					return;
131
				} else {
132
					cerr << "Unsupported apps key = " << str_key << endl;
133
				}
134
			}
135
		}
136
	}
137
}
138
139
void Applications::load() {
140
	cerr << "Loading apps file..." << endl;
141
	string apps_string = getenv("HOME")+string("/.")+RC_PATH+string("/")+"apps";
142
	ifstream apps_file(apps_string.c_str());
143
	if (!apps_file.fail()) {
144
		if (!apps_file.eof()) {
145
			string line;
146
			int row = 0;
147
			while (getline(apps_file, line) && ! apps_file.eof()) {
148
				row++;
149
				if (line[0] != '#') {
150
					string key;
151
					int pos=0;
152
					int err = StringUtil::getStringBetween(key, line.c_str(), '[', ']');
153
154
					if (key == "app") {
155
						pos += err;
156
						string label;
157
						err = StringUtil::getStringBetween(label, line.c_str()+pos, '(', ')');
158
						if (err>0) {
159
							Application *a;
160
							Apps::iterator i = apps.find(label);
161
							if (i==apps.end()) {
162
								a = new Application();
163
								apps[label] = a;
164
							} else
165
								a = i->second;
166
							parseApp(apps_file, a);
167
						} else
168
							cerr<<"Error in apps file. Line("<<row<<")"<<endl;
169
					}
170
				}
171
			}
172
		} else {
173
			cerr<<__FILE__<<"("<<__LINE__<< "Empty apps file" << endl;
174
		}
175
	} else {
176
		cerr << "apps file failure" << endl;
177
	}
178
}
179
180
void Applications::save() {
181
	cerr << "Saving apps file..." << endl;
182
	string apps_string = getenv("HOME")+string("/.")+RC_PATH+string("/")+"apps";
183
	ofstream apps_file(apps_string.c_str());
184
	Apps::iterator it = apps.begin();
185
	Apps::iterator it_end = apps.end();
186
	for (; it != it_end; ++it) {
187
		apps_file << "[app] (" <<  it->first << ")" << endl;
188
		Application *a = it->second;
189
		if (a->workspace_remember) {
190
			apps_file << "  [Workspace]\t{" << a->workspace << "}" << endl;
191
		}
192
		if (a->dimensions_remember) {
193
			apps_file << "  [Dimensions]\t{" << a->w << " " << a->h << "}" << endl;
194
		}
195
		if (a->position_remember) {
196
			apps_file << "  [Position]\t{" << a->x << " " << a->y << "}" << endl;
197
		}
198
		if (a->shadedstate_remember) {
199
			apps_file << "  [Shaded]\t{" << ((a->shadedstate)?"yes":"no") << "}" << endl;
200
		}
201
		if (a->tabstate_remember) {
202
			apps_file << "  [Tab]\t\t{" << ((a->tabstate)?"yes":"no") << "}" << endl;
203
		}
204
		if (a->decostate_remember) {
205
			switch (a->decostate) {
206
			case (FluxboxWindow::DECOR_NONE) :
207
				apps_file << "  [Deco]\t{NONE}" << endl; break;
208
			case (FluxboxWindow::DECOR_NORMAL) :
209
				apps_file << "  [Deco]\t{NORMAL}" << endl; break;
210
			case (FluxboxWindow::DECOR_TINY) :
211
				apps_file << "  [Deco]\t{TINY}" << endl; break;
212
			case (FluxboxWindow::DECOR_TOOL) :
213
				apps_file << "  [Deco]\t{TOOL}" << endl; break;
214
			}
215
		}
216
		if (a->stuckstate_remember) {
217
			apps_file << "  [Sticky]\t{" << ((a->stuckstate)?"yes":"no") << "}" << endl;
218
		}
219
		if (a->jumpworkspace_remember) {
220
			apps_file << "  [Jump]\t{" << ((a->jumpworkspace)?"yes":"no") << "}" << endl;
221
		}
222
		if (a->save_on_close_remember) {
223
			apps_file << "  [Close]\t{" << ((a->save_on_close)?"yes":"no") << "}" << endl;
224
		}
225
		apps_file << "[end]" << endl;
226
	}
227
}
(-)fluxbox-0.1.14/src/Application.hh (+103 lines)
Line 0 Link Here
1
// Application.hh for Fluxbox Window Manager
2
// Copyright (c) 2002 Xavier Brouckaert
3
// 
4
// Permission is hereby granted, free of charge, to any person obtaining a
5
// copy of this software and associated documentation files (the "Software"),
6
// to deal in the Software without restriction, including without limitation
7
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
8
// and/or sell copies of the Software, and to permit persons to whom the
9
// Software is furnished to do so, subject to the following conditions:
10
//
11
// The above copyright notice and this permission notice shall be included in
12
// all copies or substantial portions of the Software.
13
//
14
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17
// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20
// DEALINGS IN THE SOFTWARE.
21
22
#ifndef	 APPLICATION_HH
23
#define	 APPLICATION_HH
24
25
#include <iostream>
26
#include <fstream>
27
#include <string>
28
#include <map>
29
#include "Window.hh"
30
#include "StringUtil.hh"
31
32
using namespace std;
33
34
class Application {
35
public:
36
	Application();
37
	inline void forgetWorkspace() { workspace_remember = false; }
38
	inline void forgetDimensions() { dimensions_remember = false; }
39
	inline void forgetPosition() { position_remember = false; }
40
	inline void forgetShadedstate() { shadedstate_remember = false; }
41
	inline void forgetTabstate() { tabstate_remember = false; }
42
	inline void forgetDecostate() { decostate_remember = false; }
43
	inline void forgetStuckstate() { stuckstate_remember = false; }
44
	inline void forgetJumpworkspace() { jumpworkspace_remember = false; }
45
	inline void forgetSave() { save_on_close_remember = false; }
46
47
	inline void rememberWorkspace(int ws) { workspace = ws; workspace_remember = true; }
48
	inline void rememberDimensions(int width, int height) { w = width; h = height; dimensions_remember = true; }
49
	inline void rememberPosition(int posx, int posy) { x = posx; y = posy; position_remember = true; }
50
	inline void rememberShadedstate(bool state) { shadedstate = state; shadedstate_remember = true; }
51
	inline void rememberTabstate(bool state) { tabstate = state; tabstate_remember = true; }
52
	inline void rememberDecostate(FluxboxWindow::Decoration state) { decostate = state; decostate_remember = true; }
53
	inline void rememberStuckstate(bool state) { stuckstate = state; stuckstate_remember = true; }
54
	inline void rememberJumpworkspace(bool state) { jumpworkspace = state; jumpworkspace_remember = true; }
55
	inline void rememberSave(bool state) { save_on_close = state; save_on_close_remember = true; }
56
57
58
	bool workspace_remember;
59
	unsigned int workspace;
60
61
	bool dimensions_remember;
62
	int w,h; // width, height
63
64
	bool position_remember;
65
	int x,y;
66
67
	bool shadedstate_remember;
68
	bool shadedstate;
69
70
	bool tabstate_remember;
71
	bool tabstate;
72
73
	bool decostate_remember;
74
	FluxboxWindow::Decoration decostate;
75
76
	bool stuckstate_remember;
77
	bool stuckstate;
78
79
	bool jumpworkspace_remember;
80
	bool jumpworkspace;
81
82
	bool save_on_close_remember;
83
	bool save_on_close;
84
};
85
86
typedef std::map<string,Application *> Apps;
87
88
class Applications {
89
private:
90
	void parseApp(ifstream &file, Application *a);
91
	Apps apps;
92
93
public:
94
	Applications();
95
96
	Application* find(char* app_name);
97
	Application* add(char* app_name);
98
99
	void load();
100
	void save();
101
};
102
103
#endif
(-)fluxbox-0.1.14/src/Basemenu.hh (-1 / +3 lines)
Lines 110-115 Link Here
110
	bool hasSubmenu(unsigned int index) const;
110
	bool hasSubmenu(unsigned int index) const;
111
	bool isItemSelected(unsigned int index) const;
111
	bool isItemSelected(unsigned int index) const;
112
	bool isItemEnabled(unsigned int index) const;
112
	bool isItemEnabled(unsigned int index) const;
113
	typedef std::vector<BasemenuItem *> Menuitems;
114
	inline Menuitems *getMenuitems() { return &menuitems; }
113
	//@}
115
	//@}
114
116
115
protected:
117
protected:
Lines 130-136 Link Here
130
132
131
private:
133
private:
132
134
133
	typedef std::vector<BasemenuItem *> Menuitems;
135
	//typedef std::vector<BasemenuItem *> Menuitems;
134
	BScreen *m_screen;
136
	BScreen *m_screen;
135
	Display *m_display;
137
	Display *m_display;
136
	Basemenu *m_parent;
138
	Basemenu *m_parent;
(-)fluxbox-0.1.14/src/Makefile.am (-1 / +2 lines)
Lines 60-65 Link Here
60
	Tab.hh Tab.cc Theme.hh Theme.cc Timer.cc Timer.hh Toolbar.cc Toolbar.hh Observer.cc Observer.hh\
60
	Tab.hh Tab.cc Theme.hh Theme.cc Timer.cc Timer.hh Toolbar.cc Toolbar.hh Observer.cc Observer.hh\
61
	Window.cc Window.hh Windowmenu.cc Windowmenu.hh \
61
	Window.cc Window.hh Windowmenu.cc Windowmenu.hh \
62
	Workspace.cc Workspace.hh Workspacemenu.cc Workspacemenu.hh \
62
	Workspace.cc Workspace.hh Workspacemenu.cc Workspacemenu.hh \
63
	XrmDatabaseHelper.hh	
63
	XrmDatabaseHelper.hh \
64
	Application.hh Application.cc
64
65
65
LDADD=FbTk/libFbTk.a
66
LDADD=FbTk/libFbTk.a
(-)fluxbox-0.1.14/src/Rootmenu.cc (+10 lines)
Lines 155-158 Link Here
155
	return w;
155
	return w;
156
}
156
}
157
157
158
Basemenu* Rootmenu::getStartupMenu() {
159
	for (unsigned int i=0;i<numberOfItems();i++) {
160
		BasemenuItem *item = find(i);
161
		if (item->label()=="Startup") {
162
			return item->submenu();
163
		}
164
	}
165
	return NULL;
166
}
167
158
168
(-)fluxbox-0.1.14/src/Rootmenu.hh (+1 lines)
Lines 32-37 Link Here
32
	explicit Rootmenu(BScreen *scr);
32
	explicit Rootmenu(BScreen *scr);
33
	void setAutoGroupWindow(Window window);
33
	void setAutoGroupWindow(Window window);
34
	void show();
34
	void show();
35
        Basemenu* getStartupMenu();
35
36
36
protected:
37
protected:
37
  virtual void itemSelected(int button, unsigned int index);
38
  virtual void itemSelected(int button, unsigned int index);
(-)fluxbox-0.1.14/src/Screen.cc (+1 lines)
Lines 290-295 Link Here
290
	root_colormap_installed = true;
290
	root_colormap_installed = true;
291
291
292
	fluxbox->load_rc(this);
292
	fluxbox->load_rc(this);
293
	fluxbox->getApplications()->load();
293
294
294
	image_control->setDither(*resource.image_dither);
295
	image_control->setDither(*resource.image_dither);
295
	theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(), 
296
	theme = new Theme(disp, getRootWindow(), colormap(), getScreenNumber(), 
(-)fluxbox-0.1.14/src/Window.cc (-13 / +130 lines)
Lines 35-40 Link Here
35
#include "StringUtil.hh"
35
#include "StringUtil.hh"
36
#include "Netizen.hh"
36
#include "Netizen.hh"
37
#include "Keys.hh"
37
#include "Keys.hh"
38
#include "Application.hh"
38
39
39
#ifdef HAVE_CONFIG_H
40
#ifdef HAVE_CONFIG_H
40
#include "config.h"
41
#include "config.h"
Lines 72-77 Link Here
72
lastButtonPressTime(0),
73
lastButtonPressTime(0),
73
m_windowmenu(0),
74
m_windowmenu(0),
74
m_layer(LAYER_NORMAL), old_decoration(DECOR_NORMAL),
75
m_layer(LAYER_NORMAL), old_decoration(DECOR_NORMAL),
76
decor(false),
75
tab(0) {
77
tab(0) {
76
	
78
	
77
	lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0;
79
	lastFocusTime.tv_sec = lastFocusTime.tv_usec = 0;
Lines 307-317 Link Here
307
		m_windowmenu = tmp;
309
		m_windowmenu = tmp;
308
	}
310
	}
309
311
310
	if (workspace_number < 0 || workspace_number >= screen->getCount())
311
		screen->getCurrentWorkspace()->addWindow(this, place_window);
312
	else
313
		screen->getWorkspace(workspace_number)->addWindow(this, place_window);
314
315
	configure(frame.x, frame.y, frame.width, frame.height);
312
	configure(frame.x, frame.y, frame.width, frame.height);
316
313
317
	if (shaded) {
314
	if (shaded) {
Lines 325-342 Link Here
325
		maximize(m);
322
		maximize(m);
326
	}	
323
	}	
327
324
328
	if (stuck) {
329
		stuck = false;
330
		stick();
331
		deiconify(); //omnipresent, so show it
332
	}
333
334
	setFocusFlag(false);
325
	setFocusFlag(false);
335
326
336
#ifdef DEBUG
327
#ifdef DEBUG
337
	fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
328
	fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this);
338
#endif // DEBUG
329
#endif // DEBUG
339
330
331
       char *app_name = getWMClass();
332
       bool workspace_set = false;
333
       if ((app_name) && (!checkTransient2())) {
334
               Application* a = Fluxbox::instance()->getApplications()->find(app_name);
335
               if (a) {  // Information exists about this application
336
                       if (a->workspace_remember) {
337
                               screen->getWorkspace(a->workspace)->addWindow(this, place_window);
338
                               workspace_set = true;
339
                               if ((a->jumpworkspace_remember) && (a->jumpworkspace)) {
340
                                       screen->changeWorkspaceID(a->workspace);
341
                               } else {
342
                                       if ((screen->getCurrentWorkspaceID() != a->workspace) && (tab))
343
                                               tab->withdraw();
344
                               }
345
                       }
346
                       if (a->dimensions_remember) {
347
                               place_window = false;
348
                               configure(frame.x, frame.y, a->w, a->h);
349
                       }
350
                       if (a->position_remember) {
351
                               place_window = false;
352
                               configure(a->x, a->y, frame.width, frame.height);
353
                       }
354
                       if (a->shadedstate_remember) {
355
                               if (a->shadedstate) {
356
                                       shade();
357
                                       if (tab)
358
                                               tab->shade();
359
                               } else {
360
                                       // Do nothing by now : default is not shaded
361
                               }
362
                       }
363
                       if (a->tabstate_remember) {
364
                               setTab(a->tabstate);
365
                       }
366
                       if (a->decostate_remember) {
367
                               setDecoration(a->decostate);
368
                       }
369
                       if (a->stuckstate_remember) {
370
                               if (a->stuckstate) {
371
                                       screen->getCurrentWorkspace()->addWindow(
372
                                           this, place_window);
373
                                       workspace_set = true;
374
                                       stick();
375
						}
376
                               // FIXME: unstick() has been defined in
377
                               // Window.hh but not implemented !!!
378
                               // else
379
                               //      unstick();
380
                       }
381
               }
382
       }
383
       if (!workspace_set) {
384
               if (workspace_number < 0 || workspace_number >= screen->getCount())
385
                       screen->getCurrentWorkspace()->addWindow(this, place_window);
386
               else
387
                       screen->getWorkspace(workspace_number)->addWindow(this, place_window);
388
       }
389
390
	if (stuck) {
391
		stuck = false;
392
		stick();
393
		deiconify(); //omnipresent, so show it
394
	}
395
340
	fluxbox->ungrab();
396
	fluxbox->ungrab();
341
}
397
}
342
398
Lines 982-988 Link Here
982
void FluxboxWindow::reconfigure() {
1038
void FluxboxWindow::reconfigure() {
983
	upsize();
1039
	upsize();
984
	
1040
	
985
	if (Fluxbox::instance()->useTabs()) {
1041
	bool tab_enabled = true;
1042
	char* app_name = getWMClass();
1043
	if(app_name && (!checkTransient2()))
1044
	{
1045
		Application* a =  Fluxbox::instance()->getApplications()->find(app_name);
1046
		if(a)
1047
			if(a->tabstate_remember && !a->tabstate)
1048
				tab_enabled = false;
1049
	}
1050
	
1051
	if (Fluxbox::instance()->useTabs() && tab_enabled) {
986
		//no tab and we allowed to use tab? then create it 
1052
		//no tab and we allowed to use tab? then create it 
987
		if (!tab && isGroupable()) {
1053
		if (!tab && isGroupable()) {
988
			tab = new Tab(this, 0, 0);		
1054
			tab = new Tab(this, 0, 0);		
Lines 1068-1073 Link Here
1068
		tab->setPosition();
1134
		tab->setPosition();
1069
}
1135
}
1070
1136
1137
char* FluxboxWindow::getWMClass(void) {
1138
	XClassHint xch;
1139
1140
	if (XGetClassHint(display, client.window, &xch)) {
1141
		char *app_name = StringUtil::strdup(xch.res_name);
1142
		XFree((char *)xch.res_name);
1143
		XFree((char *)xch.res_class);
1144
		return app_name;
1145
	} else
1146
		return NULL;
1147
}
1071
1148
1072
void FluxboxWindow::getWMName() {
1149
void FluxboxWindow::getWMName() {
1073
1150
Lines 1641-1648 Link Here
1641
	}
1718
	}
1642
}
1719
}
1643
1720
1721
void FluxboxWindow::save_on_close() {
1722
	Fluxbox *fluxbox = Fluxbox::instance();
1723
	Applications *apps = fluxbox->getApplications();
1724
	Application *a = apps->find(getWMClass());
1725
	if (a!=NULL) {
1726
		if ((a->save_on_close_remember) && (a->save_on_close)) {
1727
			if (a->workspace_remember)
1728
				a->rememberWorkspace(screen->getCurrentWorkspaceID());
1729
			if (a->dimensions_remember)
1730
				a->rememberDimensions(getWidth(),getHeight());
1731
			if (a->position_remember)
1732
				a->rememberPosition(getXFrame(),getYFrame());
1733
			if (a->shadedstate_remember)
1734
				a->rememberShadedstate(isShaded());
1735
			if (a->shadedstate_remember)
1736
				a->rememberTabstate(hasTab());
1737
			if (a->decostate_remember)
1738
				a->rememberDecostate(getDecoration());
1739
			if (a->stuckstate_remember)
1740
				a->rememberStuckstate(isStuck());
1741
			if (a->jumpworkspace_remember)
1742
				a->rememberJumpworkspace(true);
1743
			apps->save();
1744
		}
1745
	}
1746
}
1644
1747
1645
void FluxboxWindow::close() {
1748
void FluxboxWindow::close() {
1749
	save_on_close();
1646
	Fluxbox *fluxbox = Fluxbox::instance();
1750
	Fluxbox *fluxbox = Fluxbox::instance();
1647
	XEvent ce;
1751
	XEvent ce;
1648
	ce.xclient.type = ClientMessage;
1752
	ce.xclient.type = ClientMessage;
Lines 2357-2363 Link Here
2357
	m_windowmenu->show();		
2461
	m_windowmenu->show();		
2358
	m_windowmenu->raise();
2462
	m_windowmenu->raise();
2359
	m_windowmenu->getSendToMenu().raise();
2463
	m_windowmenu->getSendToMenu().raise();
2360
	m_windowmenu->getSendGroupToMenu().raise();
2464
        m_windowmenu->getSendGroupToMenu().raise();
2465
        m_windowmenu->getRememberMenu().raise();
2361
}
2466
}
2362
				
2467
				
2363
void FluxboxWindow::restoreGravity() {
2468
void FluxboxWindow::restoreGravity() {
Lines 3170-3175 Link Here
3170
}
3275
}
3171
3276
3172
void FluxboxWindow::toggleDecoration() {
3277
void FluxboxWindow::toggleDecoration() {
3278
	static bool decor = false;
3173
	//don't toggle decor if the window is shaded
3279
	//don't toggle decor if the window is shaded
3174
	if (isShaded())
3280
	if (isShaded())
3175
		return;
3281
		return;
Lines 3482-3487 Link Here
3482
3588
3483
}
3589
}
3484
3590
3591
bool FluxboxWindow::checkTransient2() {
3592
	Window win;
3593
	if (XGetTransientForHint(display, client.window, &win)) 
3594
		if (win)
3595
			return true;
3596
		else 
3597
			return false;
3598
	else
3599
		return false;
3600
}
3601
3485
void FluxboxWindow::checkTransient() {
3602
void FluxboxWindow::checkTransient() {
3486
	// remove us from parent
3603
	// remove us from parent
3487
	if (client.transient_for != 0) {
3604
	if (client.transient_for != 0) {
(-)fluxbox-0.1.14/src/Window.hh (+21 lines)
Lines 43-48 Link Here
43
#include <string>
43
#include <string>
44
#include <memory>
44
#include <memory>
45
45
46
#ifdef DEBUG
47
#include <iostream>
48
#endif // DEBUG
49
46
#define PropMwmHintsElements	3
50
#define PropMwmHintsElements	3
47
51
48
class Tab;
52
class Tab;
Lines 55-60 Link Here
55
class FluxboxWindow : public TimeoutHandler {
59
class FluxboxWindow : public TimeoutHandler {
56
public:
60
public:
57
	
61
	
62
	char* getWMClass(void);
63
	
58
	enum WinLayer {
64
	enum WinLayer {
59
		LAYER_BOTTOM = 0x01, 
65
		LAYER_BOTTOM = 0x01, 
60
		LAYER_BELOW  = 0x02,
66
		LAYER_BELOW  = 0x02,
Lines 204-209 Link Here
204
	//@}
210
	//@}
205
211
206
	void setDecoration(Decoration decoration);
212
	void setDecoration(Decoration decoration);
213
	inline Decoration getDecoration() {
214
		if (!decor) {
215
			#ifdef DEBUG
216
			if ((old_decoration!=DECOR_NONE) && (old_decoration!=DECOR_NORMAL) && (old_decoration!=DECOR_TINY) && (old_decoration!=DECOR_TOOL))
217
				std::cerr<<__FILE__<<"("<<__LINE__<< "DEBUG: old_decoration fucked up" << std::endl;
218
			#endif //DEBUG
219
			return old_decoration;
220
		} else
221
			return DECOR_NONE;
222
	}
207
	void toggleDecoration();
223
	void toggleDecoration();
208
	
224
	
209
#ifdef SHAPE
225
#ifdef SHAPE
Lines 276-281 Link Here
276
		
292
		
277
	} client;
293
	} client;
278
294
295
	bool decor;
296
279
	struct _decorations {
297
	struct _decorations {
280
		bool titlebar, handle, border, iconify,
298
		bool titlebar, handle, border, iconify,
281
			maximize, close, menu, sticky, shade, tab, enabled;
299
			maximize, close, menu, sticky, shade, tab, enabled;
Lines 333-344 Link Here
333
	void stopResizing(Window win=0);
351
	void stopResizing(Window win=0);
334
	void updateIcon();
352
	void updateIcon();
335
	
353
	
354
        void save_on_close();
355
	
336
	// Decoration functions
356
	// Decoration functions
337
	void createTitlebar();
357
	void createTitlebar();
338
	void destroyTitlebar();
358
	void destroyTitlebar();
339
	void createHandle();
359
	void createHandle();
340
	void destroyHandle();
360
	void destroyHandle();
341
	void checkTransient();
361
	void checkTransient();
362
	bool checkTransient2();
342
363
343
	Window findTitleButton(int type);	
364
	Window findTitleButton(int type);	
344
365
(-)fluxbox-0.1.14/src/Windowmenu.cc (-18 / +156 lines)
Lines 38-43 Link Here
38
#include "Window.hh"
38
#include "Window.hh"
39
#include "Windowmenu.hh"
39
#include "Windowmenu.hh"
40
#include "Workspace.hh"
40
#include "Workspace.hh"
41
#include "Application.hh"
41
42
42
#include <cstring>
43
#include <cstring>
43
44
Lines 45-51 Link Here
45
window(win),
46
window(win),
46
screen(win.getScreen()),
47
screen(win.getScreen()),
47
sendToMenu(win),
48
sendToMenu(win),
48
sendGroupToMenu(win) {
49
sendGroupToMenu(win),
50
rememberMenu(win) {
49
51
50
	setTitleVisibility(False);
52
	setTitleVisibility(False);
51
	setMovable(False);
53
	setMovable(False);
Lines 63-68 Link Here
63
		WindowmenuSet, WindowmenuSendGroupTo,
65
		WindowmenuSet, WindowmenuSendGroupTo,
64
		"Send Group To ..."),
66
		"Send Group To ..."),
65
	&sendGroupToMenu);
67
	&sendGroupToMenu);
68
69
        insert(i18n->getMessage(
70
		WindowmenuSet, WindowmenuRemember,
71
		"Remember ..."),
72
	&rememberMenu);
66
	 
73
	 
67
	insert(i18n->getMessage(
74
	insert(i18n->getMessage(
68
		WindowmenuSet, WindowmenuShade,
75
		WindowmenuSet, WindowmenuShade,
Lines 103-113 Link Here
103
110
104
	update();
111
	update();
105
112
106
	setItemEnabled(2, window.hasTitlebar());
113
	setItemEnabled(3, window.hasTitlebar());
107
	setItemEnabled(3, window.isIconifiable());
114
	setItemEnabled(4, window.isIconifiable());
108
	setItemEnabled(4, window.isMaximizable());
115
	setItemEnabled(5, window.isMaximizable());
109
	setItemEnabled(9, window.isClosable());
116
	setItemEnabled(10, window.isClosable());
110
	setItemEnabled(10, window.isGroupable()); // tab option
117
	setItemEnabled(11, window.isGroupable()); // tab option
111
118
112
}
119
}
113
120
Lines 118-129 Link Here
118
125
119
126
120
void Windowmenu::show() {
127
void Windowmenu::show() {
121
	if (isItemEnabled(2)) 
128
	if (isItemEnabled(3)) 
122
		setItemSelected(2, window.isShaded());
129
		setItemSelected(3, window.isShaded());
123
	if (isItemEnabled(4)) 
130
	if (isItemEnabled(5)) 
124
		setItemSelected(4, window.isMaximized());
131
		setItemSelected(5, window.isMaximized());
125
	if (isItemEnabled(7)) 
132
	if (isItemEnabled(8)) 
126
		setItemSelected(7, window.isStuck());
133
		setItemSelected(8, window.isStuck());
127
134
128
	Basemenu::show();
135
	Basemenu::show();
129
}
136
}
Lines 192-205 Link Here
192
199
193
200
194
void Windowmenu::reconfigure() {
201
void Windowmenu::reconfigure() {
195
	setItemEnabled(1, window.hasTitlebar());
202
	setItemEnabled(3, window.hasTitlebar());
196
	setItemEnabled(2, window.isIconifiable());
203
	setItemEnabled(4, window.isIconifiable());
197
	setItemEnabled(3, window.isMaximizable());
204
	setItemEnabled(5, window.isMaximizable());
198
	setItemEnabled(8, window.isClosable());
205
	setItemEnabled(10, window.isClosable());
199
	setItemEnabled(10, window.isResizable()); // tab option only enabled if resizable
206
	setItemEnabled(12, window.isResizable()); // tab option only enabled if resizable
200
	
207
	
201
	sendToMenu.reconfigure();
208
	sendToMenu.reconfigure();
202
	sendGroupToMenu.reconfigure();
209
        sendGroupToMenu.reconfigure();
210
        rememberMenu.reconfigure();
203
	
211
	
204
	Basemenu::reconfigure();
212
	Basemenu::reconfigure();
205
}
213
}
Lines 299-303 Link Here
299
	hide();
307
	hide();
300
}
308
}
301
309
310
Windowmenu::Remembermenu::Remembermenu(FluxboxWindow &win): Basemenu(win.getScreen()),
311
m_fbwindow(win)
312
{
313
	setTitleVisibility(false);
314
	setMovable(false);
315
	setInternalMenu();
316
	update();
317
}
318
319
void Windowmenu::Remembermenu::show() {
320
	update();
321
322
	Basemenu::show();
323
}
324
325
void Windowmenu::Remembermenu::itemSelected(int button, unsigned int index) {
326
	if (button > 1) {
327
		hide();
328
		return;
329
	}
330
331
	if (button == 1) {
332
		char* app_name = fbwin().getWMClass();
333
		if (app_name) {
334
			Applications *apps = Fluxbox::instance()->getApplications();
335
			Application *a = apps->find(app_name);
336
			if (a==NULL)
337
				a = apps->add(app_name);
338
			if (!isItemSelected(index)) {
339
				switch (index) {
340
					case 0 : // Workspace
341
						a->rememberWorkspace(screen()->getCurrentWorkspaceID());
342
						break;
343
					case 1 : // Dimensions
344
						a->rememberDimensions(fbwin().getWidth(),
345
								      fbwin().getHeight());
346
						break;
347
					case 2 : // Position
348
						a->rememberPosition(fbwin().getXFrame(),
349
								    fbwin().getYFrame());
350
						break;
351
					case 3 : // Shaded state
352
						a->rememberShadedstate(fbwin().isShaded());
353
						break;
354
					case 4 : // Tab state
355
						a->rememberTabstate(fbwin().hasTab());
356
						break;
357
					case 5 : // Deco state
358
                                            a->rememberDecostate(fbwin().getDecoration());
359
						break;
360
					case 6 : // Stuck state
361
						a->rememberStuckstate(fbwin().isStuck());
362
						break;
363
					case 7 : // Jump to workspace
364
						a->rememberJumpworkspace(true);
365
						break;
366
					case 8 : // Save on close
367
						a->rememberSave(true);
368
				}
369
			} else {
370
				switch (index) {
371
					case 0 : // Workspace
372
						a->forgetWorkspace();
373
						break;
374
					case 1 : // Dimensions
375
						a->forgetDimensions();
376
						break;
377
					case 2 : // Position
378
						a->forgetPosition();
379
						break;
380
					case 3 : // Shaded state
381
						a->forgetShadedstate();
382
						break;
383
					case 4 : // Tab state
384
						a->forgetTabstate();
385
						break;
386
					case 5 : // Deco state
387
						a->forgetDecostate();
388
						break;
389
					case 6 : // Stuck state
390
						a->forgetStuckstate();
391
						break;
392
					case 7 : // Jump to workspace
393
						a->forgetJumpworkspace();
394
						break;
395
					case 8 : // Save on close
396
						a->forgetSave();
397
						break;
398
				}
399
			}
400
			setItemSelected(index,!isItemSelected(index));
401
			apps->save();
402
		}
403
	}
404
	Basemenu::update();
405
}
406
302
407
408
void Windowmenu::Remembermenu::update(void) {
409
	if (numberOfItems() == 0) {
410
		I18n *i18n = I18n::instance();
411
		using namespace FBNLS;
412
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberWorkspace, "Workspace"));
413
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberDimensions, "Dimensions"));
414
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberPosition, "Position"));
415
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberShaded, "Shaded state"));
416
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberTab, "Tab state"));
417
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberDeco, "Decoration state"));
418
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberSticky, "Sticky state"));
419
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberJump, "Jump to Workspace"));
420
		insert(i18n->getMessage(WindowmenuSet, WindowmenuRememberSave, "Save settings on close"));
421
422
		// Set Selected when needed
423
		char *app_name = fbwin().getWMClass();
424
		if (app_name) {
425
			Application *a = Fluxbox::instance()->getApplications()->find(app_name);
426
			if (a) {
427
				setItemSelected(0,a->workspace_remember);
428
				setItemSelected(1,a->dimensions_remember);
429
				setItemSelected(2,a->position_remember);
430
				setItemSelected(3,a->shadedstate_remember);
431
				setItemSelected(4,a->tabstate_remember);
432
				setItemSelected(5,a->decostate_remember);
433
				setItemSelected(6,a->stuckstate_remember);
434
				setItemSelected(7,a->jumpworkspace_remember);
435
				setItemSelected(8,a->save_on_close_remember);
436
			}
437
		}
438
	}
439
	Basemenu::update();
440
}
303
441
(-)fluxbox-0.1.14/src/Windowmenu.hh (-3 / +18 lines)
Lines 36-41 Link Here
36
	Basemenu &getSendToMenu() { return sendToMenu; }
36
	Basemenu &getSendToMenu() { return sendToMenu; }
37
	const Basemenu &getSendGroupToMenu() const { return sendGroupToMenu; }	
37
	const Basemenu &getSendGroupToMenu() const { return sendGroupToMenu; }	
38
	Basemenu &getSendGroupToMenu() { return sendGroupToMenu; }
38
	Basemenu &getSendGroupToMenu() { return sendGroupToMenu; }
39
	const Basemenu &getRememberMenu() const { return rememberMenu; }
40
	Basemenu &getRememberMenu() { return rememberMenu; }
39
41
40
	void reconfigure();
42
	void reconfigure();
41
	void setClosable();
43
	void setClosable();
Lines 70-80 Link Here
70
	protected:	
72
	protected:	
71
		virtual void itemSelected(int button, unsigned int index);
73
		virtual void itemSelected(int button, unsigned int index);
72
		
74
		
73
	};
75
        };
74
	
76
        
77
 	class Remembermenu : public Basemenu {
78
 	public:
79
 		Remembermenu(FluxboxWindow &win);
80
 		void update();
81
82
                virtual void show();
83
		FluxboxWindow &fbwin() { return m_fbwindow; }
84
 	protected:
85
 		virtual void itemSelected(int button, unsigned int index);
86
 	private:
87
 		FluxboxWindow &m_fbwindow;
88
 	};
89
75
	SendtoWorkspacemenu sendToMenu;
90
	SendtoWorkspacemenu sendToMenu;
76
	SendGroupToWorkspacemenu sendGroupToMenu;
91
	SendGroupToWorkspacemenu sendGroupToMenu;
77
92
        Remembermenu rememberMenu;
78
};
93
};
79
94
80
95
(-)fluxbox-0.1.14/src/fluxbox.cc (-4 / +34 lines)
Lines 142-151 Link Here
142
142
143
#endif // HAVE_BASENAME
143
#endif // HAVE_BASENAME
144
144
145
#define RC_PATH "fluxbox"
146
#define RC_INIT_FILE "init"
147
148
149
// X event scanner for enter/leave notifies - adapted from twm
145
// X event scanner for enter/leave notifies - adapted from twm
150
typedef struct scanargs {
146
typedef struct scanargs {
151
	Window w;
147
	Window w;
Lines 2587-2589 Link Here
2587
		old_screen->updateNetizenWindowFocus();
2583
		old_screen->updateNetizenWindowFocus();
2588
2584
2589
}
2585
}
2586
2587
void Fluxbox::launchStartupProgs(void) {
2588
	ScreenList::iterator it = screenList.begin();
2589
	ScreenList::iterator it_end = screenList.end();
2590
2591
	for (; it != it_end; ++it) {
2592
		BScreen *screen = (*it);
2593
		Basemenu* startupmenu = screen->getRootmenu()->getStartupMenu();
2594
2595
		if (!startupmenu)
2596
			return;
2597
2598
		Basemenu::Menuitems* mi = startupmenu->getMenuitems();
2599
		Basemenu::Menuitems::iterator mit = mi->begin();
2600
		Basemenu::Menuitems::iterator mit_end = mi->end();
2601
		for (; mit != mit_end; ++mit) {
2602
			BasemenuItem *app = (*mit);
2603
			cerr << app->label() << endl;
2604
			if (app->exec().size()) {
2605
#ifndef __EMX__
2606
				char displaystring[MAXPATHLEN];
2607
				sprintf(displaystring, "DISPLAY=%s",
2608
					DisplayString(screen->getBaseDisplay()->getXDisplay()));
2609
				sprintf(displaystring + strlen(displaystring) - 1, "%d",
2610
					screen->getScreenNumber());
2611
2612
				bexec(app->exec().c_str(), displaystring);
2613
#else // __EMX__
2614
				spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", app->exec().c_str(), NULL);
2615
#endif // !__EMX__
2616
			}
2617
		}
2618
	}
2619
}
(-)fluxbox-0.1.14/src/fluxbox.hh (+9 lines)
Lines 27-32 Link Here
27
#ifndef	 FLUXBOX_HH
27
#ifndef	 FLUXBOX_HH
28
#define	 FLUXBOX_HH
28
#define	 FLUXBOX_HH
29
29
30
#include "Application.hh"
30
#include "Resource.hh"
31
#include "Resource.hh"
31
#include "Keys.hh"
32
#include "Keys.hh"
32
#include "BaseDisplay.hh"
33
#include "BaseDisplay.hh"
Lines 72-77 Link Here
72
73
73
class AtomHandler;
74
class AtomHandler;
74
75
76
#define RC_PATH "fluxbox"
77
#define RC_INIT_FILE "init"
78
75
/**
79
/**
76
	main class for the window manager.
80
	main class for the window manager.
77
	singleton type
81
	singleton type
Lines 189-194 Link Here
189
	
193
	
190
	typedef std::vector<Fluxbox::Titlebar> TitlebarList;
194
	typedef std::vector<Fluxbox::Titlebar> TitlebarList;
191
		
195
		
196
	inline Applications* getApplications() { return &applications; }
197
	void launchStartupProgs(void);
198
192
private:
199
private:
193
	struct cursor {
200
	struct cursor {
194
		Cursor session, move, ll_angle, lr_angle;
201
		Cursor session, move, ll_angle, lr_angle;
Lines 205-210 Link Here
205
	} resource;
212
	} resource;
206
		
213
		
214
	Applications applications;
215
 
207
	std::string getRcFilename();
216
	std::string getRcFilename();
208
	void getDefaultDataFilename(char *, std::string &);
217
	void getDefaultDataFilename(char *, std::string &);
209
	void load_rc();
218
	void load_rc();
(-)fluxbox-0.1.14/src/main.cc (+1 lines)
Lines 197-202 Link Here
197
	try {
197
	try {
198
		
198
		
199
		fluxbox = new Fluxbox(argc, argv, session_display, rc_file);
199
		fluxbox = new Fluxbox(argc, argv, session_display, rc_file);
200
		fluxbox->launchStartupProgs();
200
		fluxbox->eventLoop();
201
		fluxbox->eventLoop();
201
		
202
		
202
	} catch (std::out_of_range oor) {
203
	} catch (std::out_of_range oor) {

Return to bug 18699