X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=src%2FEmacsShell-sub.c;h=1a59ac35f78fa68b6c82ecacccfba879740be8ab;hb=2964f927ca085a8362a6f47f2cde03d5afe10824;hp=4abacff342221361f1ad07e917e13bfe65fe044b;hpb=6883ee56ec887c2c48abe5b06b5e66aa74031910;p=chise%2Fxemacs-chise.git.1 diff --git a/src/EmacsShell-sub.c b/src/EmacsShell-sub.c index 4abacff..1a59ac3 100644 --- a/src/EmacsShell-sub.c +++ b/src/EmacsShell-sub.c @@ -90,6 +90,8 @@ Boston, MA 02111-1307, USA. */ #include #include "EmacsShellP.h" +#define ABORT abort + #if defined (DEFINE_TOP_LEVEL_EMACS_SHELL) #define EMACS_SHELL_WIDGET TopLevelEmacsShellWidget #define SUPERCLASS_WIDGET_CLASS topLevelShellWidgetClass @@ -137,26 +139,32 @@ static XtResource resources[] = { the default values for X and Y, for no obvious reason. This causes Shell to indicate that the defaults of (0,0) were program-specified, instead of letting the WM do what it wants. */ - {XtNx, XtCPosition, XtRPosition, sizeof(Position), - coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE}, - {XtNy, XtCPosition, XtRPosition, sizeof(Position), - coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE}, + { XtNx, XtCPosition, + XtRPosition, sizeof (Position), + coreoffset (x), XtRImmediate, (XtPointer)BIGSIZE }, + { XtNy, XtCPosition, + XtRPosition, sizeof (Position), + coreoffset (y), XtRImmediate, (XtPointer)BIGSIZE }, #endif - { XtNwidthCells, XtCWidthCells, XtRInt, sizeof(int), - offset (width_cells), XtRImmediate, (XtPointer)0}, - { XtNheightCells, XtCHeightCells, XtRInt, sizeof(int), - offset (height_cells), XtRImmediate, (XtPointer)0}, - { XtNminWidthCells, XtCMinWidthCells, XtRInt, sizeof(int), - offset (min_width_cells), XtRImmediate, (XtPointer)0}, - { XtNminHeightCells, XtCMinHeightCells, XtRInt, sizeof(int), - offset (min_height_cells), XtRImmediate, (XtPointer)0}, + { XtNwidthCells, XtCWidthCells, + XtRInt, sizeof (int), + offset (width_cells), XtRImmediate, (XtPointer)0 }, + { XtNheightCells, XtCHeightCells, + XtRInt, sizeof (int), + offset (height_cells), XtRImmediate, (XtPointer)0 }, + { XtNminWidthCells, XtCMinWidthCells, + XtRInt, sizeof (int), + offset (min_width_cells), XtRImmediate, (XtPointer)0 }, + { XtNminHeightCells, XtCMinHeightCells, + XtRInt, sizeof (int), + offset (min_height_cells), XtRImmediate, (XtPointer)0 }, }; static CompositeClassExtensionRec compositeClassExtRec = { NULL, NULLQUARK, XtCompositeExtensionVersion, - sizeof(CompositeClassExtensionRec), + sizeof (CompositeClassExtensionRec), TRUE, }; @@ -164,7 +172,7 @@ static ShellClassExtensionRec shellClassExtRec = { NULL, NULLQUARK, XtShellExtensionVersion, - sizeof(ShellClassExtensionRec), + sizeof (ShellClassExtensionRec), RootGeometryManager }; @@ -174,7 +182,7 @@ EMACS_SHELL_CLASS_REC_TYPE EMACS_SHELL_CLASS_REC = { */ /* superclass */ (WidgetClass) &SUPERCLASS_CLASS_REC, /* class_name */ (String) EMACS_SHELL_CLASS_NAME, - /* size */ sizeof(EMACS_SHELL_REC), + /* size */ sizeof (EMACS_SHELL_REC), /* Class Initializer */ NULL, /* class_part_initialize*/ NULL, /* XtInheritClassPartInitialize, */ /* Class init'ed ? */ FALSE, @@ -186,9 +194,9 @@ EMACS_SHELL_CLASS_REC_TYPE EMACS_SHELL_CLASS_REC = { /* resources */ resources, /* resource_count */ XtNumber (resources), /* xrm_class */ NULLQUARK, - /* compress_motion */ FALSE, - /* compress_exposure */ TRUE, - /* compress_enterleave*/ FALSE, + /* compress_motion */ TRUE, + /* compress_exposure */ XtExposeCompressMaximal | XtExposeNoRegion, + /* compress_enterleave*/ TRUE, /* visible_interest */ TRUE, /* destroy */ NULL, /* resize */ XtInheritResize, @@ -280,7 +288,7 @@ SuperClassRootGeometryManager (Widget gw, } if (!gcer) - abort (); + ABORT (); /* call it to actually make the geometry request */ scer = (ShellClassExtensionRec *) gcer; @@ -298,7 +306,7 @@ RootGeometryManager (Widget gw, XtGeometryResult result; if (reentrant) - abort (); + ABORT (); reentrant++; #ifdef DEBUG_GEOMETRY_MANAGEMENT @@ -327,11 +335,16 @@ RootGeometryManager (Widget gw, result == XtGeometryAlmost ? "XtGeometryAlmost" : "XtGeometryDone"); if (reply->request_mode & CWWidth) - printf ("width returned;"); + printf ("width returned was %d%s", + reply->width, + reply->request_mode & CWHeight ? "; " : ".\n"); if (reply->request_mode & CWHeight) - printf ("height returned;"); - printf ("\n"); - printf (" resulting shell size: %d %d\n", reply->width, reply->height); + printf ("height returned was %d.\n", reply->height); + /* #### does this also need to depend on the result? + With XtGeometryYes there doesn't seem to be a useful reply object. */ + printf (" resulting shell size: %d %d\n", + reply->request_mode & CWWidth ? reply->width : w->core.width, + reply->request_mode & CWHeight ? reply->height : w->core.height); printf ("----------\n"); fflush (stdout); #endif @@ -358,11 +371,11 @@ ChangeManaged (Widget wid) for (i = 0; i < w->composite.num_children; i++) { if (XtIsManaged(w->composite.children[i])) { child = w->composite.children[i]; + update_size_hints_internal (w, child->core.width, + child->core.height); break; } } - - update_size_hints_internal (w, child->core.width, child->core.height); } /* call the real ChangeManaged */