X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5ed99d3685cc8d13f8e4c63ad449a6e4d63c8eb0..6a3d20cc46da1e59f230923056b6b351acb097b9:/src/widget.c diff --git a/src/widget.c b/src/widget.c index 0582718948..b94c30f4e9 100644 --- a/src/widget.c +++ b/src/widget.c @@ -1,5 +1,5 @@ /* The emacs frame widget. - Copyright (C) 1992-1993, 2000-2011 Free Software Foundation, Inc. + Copyright (C) 1992-1993, 2000-2012 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -429,25 +429,15 @@ set_frame_size (EmacsFrame ew) { /* the tricky things with the sign is to make sure that -0 is printed -0. */ - int len; - char *tem; sprintf (shell_position, "=%c%d%c%d", flags & XNegative ? '-' : '+', x < 0 ? -x : x, flags & YNegative ? '-' : '+', y < 0 ? -y : y); - len = strlen (shell_position) + 1; - tem = (char *) xmalloc (len); - strncpy (tem, shell_position, len); - XtVaSetValues (wmshell, XtNgeometry, tem, NULL); + XtVaSetValues (wmshell, XtNgeometry, xstrdup (shell_position), NULL); } else if (flags & (WidthValue | HeightValue)) { - int len; - char *tem; sprintf (shell_position, "=%dx%d", pixel_width, pixel_height); - len = strlen (shell_position) + 1; - tem = (char *) xmalloc (len); - strncpy (tem, shell_position, len); - XtVaSetValues (wmshell, XtNgeometry, tem, NULL); + XtVaSetValues (wmshell, XtNgeometry, xstrdup (shell_position), NULL); } /* If the geometry spec we're using has W/H components, mark the size @@ -476,6 +466,9 @@ update_wm_hints (EmacsFrame ew) int base_height; int min_rows = 0, min_cols = 0; + /* This happens when the frame is just created. */ + if (! wmshell) return; + #if 0 check_frame_size (ew->emacs_frame.frame, &min_rows, &min_cols); #endif @@ -506,6 +499,14 @@ update_wm_hints (EmacsFrame ew) NULL); } +void +widget_update_wm_size_hints (Widget widget) +{ + EmacsFrame ew = (EmacsFrame)widget; + update_wm_hints (ew); +} + + #if 0 static void @@ -808,7 +809,7 @@ EmacsFrameQueryGeometry (Widget widget, XtWidgetGeometry *request, XtWidgetGeome return result->request_mode ? XtGeometryAlmost : XtGeometryYes; } -/* Special entrypoints */ +/* Special entry points */ void EmacsFrameSetCharSize (Widget widget, int columns, int rows) {