On 02.03.2012 23:03 (UTC+1), Brad Jorsch wrote:
On Thu, Mar 01, 2012 at 07:30:11PM +0100, Rainer Hurling wrote:
Thanks for your help. I patched main.c in the way you recommended,
but there appears no window with the desired messages. Is it
possible, that %d is not the right type for this, also?
wmessage doesn't open a window, it writes to stderr. If you started WM
from a console, the messages should appear on that console; otherwise
they are probably redirected to a file somewhere, e.g.
~/.xsession-errors.
Oops, my fault. Thanks for the clarification. Because the faulty patch
(with %s instead of %d) opens a window in wmaker, I thougt, wmessage
will do it, too.
Before starting wmaker, I reinstalled it with three patches (attached).
patch-clang-warnings is from Doug Barton for some obvious error in the
sources;
patch-src__startup2.c brings in a patch for the wmessage, Doug Barton
suggested me some time ago and
patch-src__main.c should contain the code you (Brad) suggested three
days ago.
When starting wmaker, some of these wmessages write onto the console. I
summarized them in the following lines:
/usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: (null)
/usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: (null)
/usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real
/usr/local/bin/wmaker(real_main(main.c:632)): Got --for-real, set
restarting = 0
/usr/local/bin/wmaker(main(main.c:550)): restarting: 0, norestore: (null)
/usr/local/bin/wmaker(main(main.c:552)): Arg 1 is --for-real=
/usr/local/bin/wmaker(real_main(main.c:635)): Got --for-real=, set
restarting = 1
/usr/local/bin/wmaker(StartUp(startup.c:766)): norestore: 0
Lines like this are only created on startup of wmaker. When I try to
save a session, clear a session or restart wmaker, nothing happens any
more with our wmessages.
For me it is a bit hard to interpret the lines. If you detect something
of the odd behaviour of wmaker on FreeBSD this would be great.
Please let me know if I should provide more information or test something.
Thanks and sorry for the delay, I had been on a short trip,
Rainer
diff -ur ../WindowMaker-0.95.2-pre-clang/src/actions.c ./src/actions.c
--- ../WindowMaker-0.95.2-pre-clang/src/actions.c 2012-02-14
11:36:01.000000000 -0800
+++ ./src/actions.c 2012-02-25 02:29:30.000000000 -0800
@@ -60,6 +60,9 @@
unsigned int *new_width, unsigned int
*new_height);
static void save_old_geometry(WWindow *wwin);
+/* In usermenu.c */
+void wUserMenuRefreshInstances(WMenu * menu, WWindow * wwin);
+
/******* Local Variables *******/
static struct {
int steps;
diff -ur ../WindowMaker-0.95.2-pre-clang/src/event.c ./src/event.c
--- ../WindowMaker-0.95.2-pre-clang/src/event.c 2012-02-14 11:36:01.000000000
-0800
+++ ./src/event.c 2012-02-25 02:30:58.000000000 -0800
@@ -130,9 +130,11 @@
static void handleFocusIn(XEvent *event);
static void handleMotionNotify(XEvent *event);
static void handleVisibilityNotify(XEvent *event);
-static void handle_inotify_events(int fd, int wd);
static void wdelete_death_handler(WMagicNumber id);
+#ifdef HAVE_INOTIFY
+static void handle_inotify_events(int fd, int wd);
+#endif
#ifdef SHAPE
static void handleShapeNotify(XEvent *event);
diff -ur ../WindowMaker-0.95.2-pre-clang/src/osdep_bsd.c ./src/osdep_bsd.c
--- ../WindowMaker-0.95.2-pre-clang/src/osdep_bsd.c 2012-02-14
11:36:01.000000000 -0800
+++ ./src/osdep_bsd.c 2012-02-25 02:31:25.000000000 -0800
@@ -85,7 +85,7 @@
mib[0] = CTL_KERN;
mib[1] = KERN_ARGMAX;
mib[2] = 0;
- mib[4] = 0;
+ mib[3] = 0;
count = sizeof(argmax);
if (sysctl(mib, 2, &argmax, &count, NULL, 0) == -1)
diff -ur ../WindowMaker-0.95.2-pre-clang/src/usermenu.c ./src/usermenu.c
--- ../WindowMaker-0.95.2-pre-clang/src/usermenu.c 2012-02-14
11:36:01.000000000 -0800
+++ ./src/usermenu.c 2012-02-25 02:37:25.000000000 -0800
@@ -82,6 +82,9 @@
/*** var ***/
extern WPreferences wPreferences;
+/* In xmodifier.c */
+int wXModifierFromKey(char *key);
+
typedef struct {
WScreen *screen;
WShortKey *key;
@@ -133,7 +136,6 @@
WUserMenuData *data;
KeySym ksym;
char *k;
- char *buffer;
char buf[MAX_SHORTCUT_LENGTH], *b;
int keycount, i, j, mod;
@@ -283,7 +285,6 @@
void wUserMenuRefreshInstances(WMenu * menu, WWindow * wwin)
{
- WMenuEntry *entry;
int i, j, count, paintflag;
paintflag = 0;
@@ -324,13 +325,11 @@
static WMenu *readUserMenuFile(WScreen * scr, char *file_name)
{
WMenu *menu;
- char *mtitle;
- WMPropList *plum, *elem, *title, *command, *params;
- int count, i;
+ WMPropList *plum;
menu = NULL;
plum = WMReadPropListFromFile(file_name);
- /**/ if (plum) {
+ if (plum) {
menu = configureUserMenu(scr, plum);
WMReleasePropList(plum);
}
@@ -340,7 +339,6 @@
WMenu *wUserMenuGet(WScreen * scr, WWindow * wwin)
{
WMenu *menu = NULL;
- char buffer[100];
char *path = NULL;
char *tmp;
if (wwin->wm_instance && wwin->wm_class) {
--- src/main.c.orig 2012-02-14 20:36:01.000000000 +0100
+++ src/main.c 2012-03-01 17:50:45.000000000 +0100
@@ -546,6 +546,12 @@
memset(&wPreferences, 0, sizeof(WPreferences));
+ wmessage("restarting: %d, norestore: %s\n",
+ wPreferences.flags.restarting, wPreferences.flags.norestore);
+ for (i = 1; i < argc; i++) {
+ wmessage("Arg %d is %s", i, argv[i]);
+ }
+
wPreferences.fallbackWMs = WMCreateArray(8);
alt = getenv("WINDOWMAKER_ALT_WM");
if (alt != NULL)
@@ -623,15 +629,19 @@
#endif
if (strcmp(argv[i], "--for-real") == 0) {
wPreferences.flags.restarting = 0;
+ wmessage("Got %s, set restarting = %d",
argv[i], wPreferences.flags.restarting);
} else if (strcmp(argv[i], "--for-real=") == 0) {
wPreferences.flags.restarting = 1;
+ wmessage("Got %s, set restarting = %d",
argv[i], wPreferences.flags.restarting);
} else if (strcmp(argv[i], "--for-real-") == 0) {
wPreferences.flags.restarting = 2;
+ wmessage("Got %s, set restarting = %d",
argv[i], wPreferences.flags.restarting);
} else if (strcmp(argv[i], "-no-autolaunch") == 0
|| strcmp(argv[i], "--no-autolaunch") == 0) {
wPreferences.flags.noautolaunch = 1;
} else if (strcmp(argv[i], "-dont-restore") == 0 ||
strcmp(argv[i], "--dont-restore") == 0) {
wPreferences.flags.norestore = 1;
+ wmessage("Got %s, set norestore = %d",
argv[i], wPreferences.flags.norestore);
} else if (strcmp(argv[i], "-nodock") == 0 ||
strcmp(argv[i], "--no-dock") == 0) {
wPreferences.flags.nodock = 1;
} else if (strcmp(argv[i], "-noclip") == 0 ||
strcmp(argv[i], "--no-clip") == 0) {
--- src/startup.c.orig 2012-02-14 20:36:01.000000000 +0100
+++ src/startup.c 2012-03-04 08:29:04.000000000 +0100
@@ -761,9 +761,10 @@
wMenuRestoreState(wScreen[j]);
/* If we're not restarting, restore session */
- if (wPreferences.flags.restarting == 0 &&
!wPreferences.flags.norestore)
+ if (wPreferences.flags.restarting == 0 &&
!wPreferences.flags.norestore) {
wSessionRestoreState(wScreen[j]);
-
+ wmessage("restarting: %d, norestore: %d\n",
wPreferences.flags.restarting, wPreferences.flags.norestore);
+ }
if (!wPreferences.flags.noautolaunch) {
/* auto-launch apps */
if (!wPreferences.flags.nodock && wScreen[j]->dock) {