-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Sun, 21 Oct 2001, tp40 wrote:
> Hi all,
>
> I just got bbappconf up and running. I have a question:
>
> when I run it, it appears as an annoying rectangle at the top-left hand
> corner of my scree, kinda like bbpager, except it's just a plain little
> block. How can I get rid of it? There's no "-i" option for bbappconf it
> appears ...
I also had problems with the -i option. I patched it to get it working for
me, as well as addded some new options to the application for setting
windows' positions and sizes. See attached. :)
xOr
- --
I am damn unsatisfied to be killed in this way.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iD8DBQE71mIU8mPQRGtSu14RAvR6AKCCY6cMJ5glXcMIa421tTCiKRJ/hwCeKyaT
TDHOmYweC18w0Oz0zfi6blA=
=Ymd/
-----END PGP SIGNATURE-----
diff -u bbappconf-0.0.1-peak3/appconf.hh bbappconf-xor/appconf.hh
--- bbappconf-0.0.1-peak3/appconf.hh Mon Feb 19 12:40:11 2001
+++ bbappconf-xor/appconf.hh Tue Aug 7 02:23:52 2001
@@ -37,7 +37,11 @@
unsigned int getStartOnDesktop(void) { return start_on_desktop;}
bool getMaxHoriz(void) { return max_horiz;}
bool getMaxVert(void) {return max_vert;}
-
+ int getPositionX(void) {return position_x;}
+ int getPositionY(void) {return position_y;}
+ int getWidth(void) {return width;}
+ int getHeight(void) {return height;}
+
char *getName(void) { return appname;}
char *getClass(void) { return appclass;}
@@ -47,6 +51,10 @@
void setMaxHoriz(bool _max_horiz) {max_horiz=_max_horiz;}
void setStartOnDesktop(unsigned int _start_on_desktop)
{start_on_desktop=_start_on_desktop;}
+ void setPositionX(int _position_x) {position_x=_position_x;}
+ void setPositionY(int _position_y) {position_y=_position_y;}
+ void setWidth(int _width) {width=_width;}
+ void setHeight(int _height) {height=_height;}
private:
bool sticky;
@@ -54,7 +62,9 @@
bool max_horiz;
bool max_vert;
unsigned int start_on_desktop;
- char *appname;
+ int position_x, position_y;
+ int width, height;
+ char *appname;
char *appclass;
};
diff -u bbappconf-0.0.1-peak3/bbappconf.cc bbappconf-xor/bbappconf.cc
--- bbappconf-0.0.1-peak3/bbappconf.cc Mon Feb 19 13:57:03 2001
+++ bbappconf-xor/bbappconf.cc Tue Aug 7 02:47:38 2001
@@ -35,6 +35,7 @@
config_db = XrmGetFileDatabase("config.bb");
+ iconic = options->iconic;
desktop_nr=0;
current_desktop_nr=-1;
wm_init=False;
@@ -43,7 +44,7 @@
pushed_app=0;
MakeWindow(False);
wminterface->moduleInit();
- eventLoop();
+ eventLoop();
}
ToolWindow::~ToolWindow() {
@@ -92,9 +93,6 @@
desktop_nr=0;
-// LinkedListIterator<AppWindow> win_it(appWindowList);
-// for (; win_it.current(); win_it++)
-// addAppWindow(win_it.current(),True);
XClearWindow(getXDisplay(), framewin);
}
@@ -245,6 +168,16 @@
getWMInterface()->sendWindowToDesktop(*win,
resource->getAppConf(i)->getStartOnDesktop()-1);
}
+ /* set window size */
+ if (resource->getAppConf(i)->getWidth()>=0 &&
+ resource->getAppConf(i)->getHeight()>=0) {
+
+getWMInterface()->resizeWindow(*win,resource->getAppConf(i)->getWidth(),resource->getAppConf(i)->getHeight());
+
+ }
+ /* set window position */
+ if (resource->getAppConf(i)->getPositionX()!=-1111 &&
+ resource->getAppConf(i)->getPositionY()!=-1111) {
+
+getWMInterface()->moveWindow(*win,resource->getAppConf(i)->getPositionX(),resource->getAppConf(i)->getPositionY());
+
+ }
if (resource->getAppConf(i)->getMaxHoriz() ||
resource->getAppConf(i)->getMaxVert()) {
if (XGetWindowProperty(getXDisplay(), *win,
@@ -413,12 +346,6 @@
XSetWindowBackgroundPixmap(getXDisplay(), framewin, pixmap.frame);
}
- if (!withdrawn && resource->report.auto_raise) {
- XRaiseWindow(getXDisplay(),framewin);
- lower=False;
- }
- else lower=True;
-
if (!reconfigure) {
// gcv.font = resource->menu.font->fid;
@@ -460,7 +387,7 @@
XMapWindow(getXDisplay(), framewin);
XMapSubwindows(getXDisplay(), framewin);
if (iconic) {
- getWMInterface()->setIconicState(framewin,true);
+ getWMInterface()->setIconicState(framewin, True);
}
}
diff -u bbappconf-0.0.1-peak3/bbappconf.hh bbappconf-xor/bbappconf.hh
--- bbappconf-0.0.1-peak3/bbappconf.hh Tue Oct 10 14:34:27 2000
+++ bbappconf-xor/bbappconf.hh Tue Aug 7 02:33:55 2001
@@ -97,11 +97,11 @@
private:
- bool lower;
bool wm_init;
int day,month,year;
int number_of_icons;
+ bool iconic;
int current_desktop_nr;
PIXMAP pixmap;
struct GEOMM frame;
Common subdirectories: bbappconf-0.0.1-peak3/data and bbappconf-xor/data
diff -u bbappconf-0.0.1-peak3/resource.cc bbappconf-xor/resource.cc
--- bbappconf-0.0.1-peak3/resource.cc Mon Feb 19 13:17:56 2001
+++ bbappconf-xor/resource.cc Tue Aug 7 02:23:52 2001
@@ -61,6 +61,8 @@
int i;
char rclass[40];
char rname[40];
+ int position_x, position_y;
+ int width, height;
if ((XrmGetResource(resource_db, "bbappconf.numberOf.configs",
"Bbappconf.NumberOf.Configs",
@@ -164,7 +166,50 @@
app_conf[i].setMaxHoriz(false);
}
-
+ sprintf(rclass, "Bbappconf.%d.Width",i+1);
+ sprintf(rname, "bbappconf.%d.width",i+1);
+ if ((XrmGetResource(resource_db, rname,rclass,
+
+ &value_type, &value))) {
+ if (sscanf(value.addr, "%u", &width) != 1) {
+ width = -1;
+ }
+ } else
+ width=-1;
+ app_conf[i].setWidth(width);
+
+ sprintf(rclass, "Bbappconf.%d.Height",i+1);
+ sprintf(rname, "bbappconf.%d.height",i+1);
+ if ((XrmGetResource(resource_db, rname,rclass,
+
+ &value_type, &value))) {
+ if (sscanf(value.addr, "%u", &height) != 1) {
+ height = -1;
+ }
+ } else
+ height=-1;
+ app_conf[i].setHeight(height);
+
+ sprintf(rclass, "Bbappconf.%d.PositionX",i+1);
+ sprintf(rname, "bbappconf.%d.positionX",i+1);
+ if ((XrmGetResource(resource_db, rname,rclass,
+ &value_type, &value))) {
+ if (sscanf(value.addr, "%u", &position_x) != 1) {
+ position_x = -1111;
+ }
+ } else
+ position_x=-1111;
+ app_conf[i].setPositionX(position_x);
+
+ sprintf(rclass, "Bbappconf.%d.PositionY",i+1);
+ sprintf(rname, "bbappconf.%d.positionY",i+1);
+ if ((XrmGetResource(resource_db, rname,rclass,
+ &value_type, &value))) {
+ if (sscanf(value.addr, "%u", &position_y) != 1) {
+ position_y = -1111;
+ }
+ } else
+ position_y=-1111;
+ app_conf[i].setPositionY(position_y);
+
}
}
diff -u bbappconf-0.0.1-peak3/wminterface.cc bbappconf-xor/wminterface.cc
--- bbappconf-0.0.1-peak3/wminterface.cc Tue Oct 17 15:03:14 2000
+++ bbappconf-xor/wminterface.cc Tue Aug 7 02:46:55 2001
@@ -285,9 +285,9 @@
void WMInterface::NETNotifyStartup() {
bbtool->setNETInit(); //wm_init=True;
- XClearWindow(bbtool->getXDisplay(), bbtool->framewin);
+/* XClearWindow(bbtool->getXDisplay(), bbtool->framewin);
XMapWindow(bbtool->getXDisplay(), bbtool->framewin);
- XMapSubwindows(bbtool->getXDisplay(), bbtool->framewin);
+ XMapSubwindows(bbtool->getXDisplay(), bbtool->framewin);*/
}
void WMInterface::NETNotifyWindowAdd(Window win,int desktop_nr) {
@@ -415,3 +415,12 @@
} else if (number_of_desktops<old_number_of_desktops)
bbtool->removeDesktopWindow();*/
}
+
+void WMInterface::moveWindow(Window win, int x, int y) {
+ XMoveWindow(bbtool->getXDisplay(), win, x, y);
+}
+
+void WMInterface::resizeWindow(Window win, int width, int height) {
+ XResizeWindow(bbtool->getXDisplay(), win, width, height);
+}
+
diff -u bbappconf-0.0.1-peak3/wminterface.hh bbappconf-xor/wminterface.hh
--- bbappconf-0.0.1-peak3/wminterface.hh Wed Oct 11 12:45:22 2000
+++ bbappconf-xor/wminterface.hh Tue Aug 7 02:23:52 2001
@@ -53,7 +53,9 @@
int getAttributes(Window);
void changeIconState(Window);
void windowAttributeChange(Window);
-
+ void moveWindow(Window,int,int);
+ void resizeWindow(Window,int,int);
+
int getNumberOfDesktops();
int getCurrentDesktop();
void changeDesktop(int);