mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
Session saves the unmaximized postion, size of a maximized window. #86059
2002-06-25 JeyaSudha <jeyasudha.duraipandy@wipro.com> * src/session.c, src/window.c: Session saves the unmaximized postion, size of a maximized window. #86059
This commit is contained in:
parent
a5c4eaa55c
commit
a6a7407faa
@ -1,3 +1,8 @@
|
||||
2002-06-25 JeyaSudha <jeyasudha.duraipandy@wipro.com>
|
||||
|
||||
* src/session.c, src/window.c: Session saves the unmaximized
|
||||
postion, size of a maximized window. #86059
|
||||
|
||||
2002-09-03 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* src/frames.c (meta_frames_update_prelit_control): don't filter
|
||||
|
@ -986,7 +986,14 @@ save_state (void)
|
||||
|
||||
/* Maximized */
|
||||
if (window->maximized)
|
||||
fputs (" <maximized/>\n", outfile);
|
||||
{
|
||||
fprintf (outfile,
|
||||
" <maximized saved_x=\"%d\" saved_y=\"%d\" saved_width=\"%d\" saved_height=\"%d\"/>\n",
|
||||
window->saved_rect.x,
|
||||
window->saved_rect.y,
|
||||
window->saved_rect.width,
|
||||
window->saved_rect.height);
|
||||
}
|
||||
|
||||
/* Workspaces we're on */
|
||||
{
|
||||
@ -1347,8 +1354,70 @@ start_element_handler (GMarkupParseContext *context,
|
||||
}
|
||||
else if (strcmp (element_name, "maximized") == 0)
|
||||
{
|
||||
int i;
|
||||
|
||||
i = 0;
|
||||
pd->info->maximized = TRUE;
|
||||
pd->info->maximized_set = TRUE;
|
||||
while (attribute_names[i])
|
||||
{
|
||||
const char *name;
|
||||
const char *val;
|
||||
|
||||
name = attribute_names[i];
|
||||
val = attribute_values[i];
|
||||
|
||||
if (strcmp (name, "saved_x") == 0)
|
||||
{
|
||||
if (*val)
|
||||
{
|
||||
pd->info->saved_rect.x = atoi (val);
|
||||
pd->info->saved_rect_set = TRUE;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "saved_y") == 0)
|
||||
{
|
||||
if (*val)
|
||||
{
|
||||
pd->info->saved_rect.y = atoi (val);
|
||||
pd->info->saved_rect_set = TRUE;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "saved_width") == 0)
|
||||
{
|
||||
if (*val)
|
||||
{
|
||||
pd->info->saved_rect.width = atoi (val);
|
||||
pd->info->saved_rect_set = TRUE;
|
||||
}
|
||||
}
|
||||
else if (strcmp (name, "saved_height") == 0)
|
||||
{
|
||||
if (*val)
|
||||
{
|
||||
pd->info->saved_rect.height = atoi (val);
|
||||
pd->info->saved_rect_set = TRUE;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
g_set_error (error,
|
||||
G_MARKUP_ERROR,
|
||||
G_MARKUP_ERROR_UNKNOWN_ATTRIBUTE,
|
||||
_("Unknown attribute %s on <maximized> element"),
|
||||
name);
|
||||
return;
|
||||
}
|
||||
|
||||
++i;
|
||||
}
|
||||
|
||||
if (pd->info->saved_rect_set)
|
||||
meta_topic (META_DEBUG_SM, "Saved unmaximized size %d,%d %dx%d \n",
|
||||
pd->info->saved_rect.x,
|
||||
pd->info->saved_rect.y,
|
||||
pd->info->saved_rect.width,
|
||||
pd->info->saved_rect.height);
|
||||
}
|
||||
else if (strcmp (element_name, "geometry") == 0)
|
||||
{
|
||||
|
@ -50,6 +50,7 @@ struct _MetaWindowSessionInfo
|
||||
*/
|
||||
int gravity;
|
||||
MetaRectangle rect;
|
||||
MetaRectangle saved_rect;
|
||||
guint on_all_workspaces : 1;
|
||||
guint minimized : 1;
|
||||
guint maximized : 1;
|
||||
@ -59,6 +60,7 @@ struct _MetaWindowSessionInfo
|
||||
guint on_all_workspaces_set : 1;
|
||||
guint minimized_set : 1;
|
||||
guint maximized_set : 1;
|
||||
guint saved_rect_set : 1;
|
||||
};
|
||||
|
||||
/* If lookup_saved_state returns something, it should be used,
|
||||
|
20
src/window.c
20
src/window.c
@ -696,7 +696,25 @@ meta_window_apply_session_info (MetaWindow *window,
|
||||
info->maximized, window->desc);
|
||||
|
||||
if (window->has_maximize_func && info->maximized)
|
||||
meta_window_maximize (window);
|
||||
{
|
||||
meta_window_maximize (window);
|
||||
|
||||
if (info->saved_rect_set)
|
||||
{
|
||||
meta_topic (META_DEBUG_SM,
|
||||
"Restoring saved rect %d,%d %dx%d for window %s\n",
|
||||
info->saved_rect.x,
|
||||
info->saved_rect.y,
|
||||
info->saved_rect.width,
|
||||
info->saved_rect.height,
|
||||
window->desc);
|
||||
|
||||
window->saved_rect.x = info->saved_rect.x;
|
||||
window->saved_rect.y = info->saved_rect.y;
|
||||
window->saved_rect.width = info->saved_rect.width;
|
||||
window->saved_rect.height = info->saved_rect.height;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (info->on_all_workspaces_set)
|
||||
|
Loading…
Reference in New Issue
Block a user