summaryrefslogtreecommitdiff
path: root/src/core/frame.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/frame.c')
-rw-r--r--src/core/frame.c64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/core/frame.c b/src/core/frame.c
index 9c12b866..68af4b52 100644
--- a/src/core/frame.c
+++ b/src/core/frame.c
@@ -2,11 +2,11 @@
/* Marco X window decorations */
-/*
+/*
* Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003, 2004 Red Hat, Inc.
* Copyright (C) 2005 Elijah Newren
- *
+ *
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
@@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
@@ -48,13 +48,13 @@ meta_window_ensure_frame (MetaWindow *window)
MetaFrame *frame;
XSetWindowAttributes attrs;
Visual *visual;
-
+
if (window->frame)
return;
-
+
/* See comment below for why this is required. */
meta_display_grab (window->display);
-
+
frame = g_new (MetaFrame, 1);
frame->window = window;
@@ -70,7 +70,7 @@ meta_window_ensure_frame (MetaWindow *window)
frame->mapped = FALSE;
frame->need_reapply_frame_shape = TRUE;
frame->is_flashing = FALSE;
-
+
meta_verbose ("Framing window %s: visual %s default, depth %d default depth %d\n",
window->desc,
XVisualIDFromVisual (window->xvisual) ==
@@ -80,7 +80,7 @@ meta_window_ensure_frame (MetaWindow *window)
meta_verbose ("Frame geometry %d,%d %dx%d\n",
frame->rect.x, frame->rect.y,
frame->rect.width, frame->rect.height);
-
+
/* Default depth/visual handles clients with weird visuals; they can
* always be children of the root depth/visual obviously, but
* e.g. DRI games can't be children of a parent that has the same
@@ -89,7 +89,7 @@ meta_window_ensure_frame (MetaWindow *window)
* We look for an ARGB visual if we can find one, otherwise use
* the default of NULL.
*/
-
+
/* Special case for depth 32 windows (assumed to be ARGB),
* we use the window's visual. Otherwise we just use the system visual.
*/
@@ -97,7 +97,7 @@ meta_window_ensure_frame (MetaWindow *window)
visual = window->xvisual;
else
visual = NULL;
-
+
frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
window->display->xdisplay,
visual,
@@ -111,7 +111,7 @@ meta_window_ensure_frame (MetaWindow *window)
attrs.event_mask = EVENT_MASK;
XChangeWindowAttributes (window->display->xdisplay,
frame->xwindow, CWEventMask, &attrs);
-
+
meta_display_register_x_window (window->display, &frame->xwindow, window);
/* Now that frame->xwindow is registered with window, we can set its
@@ -148,10 +148,10 @@ meta_window_ensure_frame (MetaWindow *window)
window->rect.y);
/* FIXME handle this error */
meta_error_trap_pop (window->display, FALSE);
-
+
/* stick frame to the window */
window->frame = frame;
-
+
if (window->title)
meta_ui_set_frame_title (window->screen->ui,
window->frame->xwindow,
@@ -167,7 +167,7 @@ meta_window_ensure_frame (MetaWindow *window)
frame->rect.height,
frame->window->has_shape);
frame->need_reapply_frame_shape = FALSE;
-
+
meta_display_ungrab (window->display);
}
@@ -175,16 +175,16 @@ void
meta_window_destroy_frame (MetaWindow *window)
{
MetaFrame *frame;
-
+
if (window->frame == NULL)
return;
meta_verbose ("Unframing window %s\n", window->desc);
-
+
frame = window->frame;
-
+
meta_bell_notify_frame_destroy (frame);
-
+
/* Unparent the client window; it may be destroyed,
* thus the error trap.
*/
@@ -214,14 +214,14 @@ meta_window_destroy_frame (MetaWindow *window)
meta_display_unregister_x_window (window->display,
frame->xwindow);
-
+
window->frame = NULL;
/* Move keybindings to window instead of frame */
meta_window_grab_keys (window);
-
+
g_free (frame);
-
+
/* Put our state back where it should be */
meta_window_queue (window, META_QUEUE_CALC_SHOWING);
meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
@@ -244,20 +244,20 @@ meta_frame_get_flags (MetaFrame *frame)
else
{
flags |= META_FRAME_ALLOWS_MENU;
-
+
if (frame->window->has_close_func)
flags |= META_FRAME_ALLOWS_DELETE;
-
+
if (frame->window->has_maximize_func)
flags |= META_FRAME_ALLOWS_MAXIMIZE;
-
+
if (frame->window->has_minimize_func)
flags |= META_FRAME_ALLOWS_MINIMIZE;
-
+
if (frame->window->has_shade_func)
flags |= META_FRAME_ALLOWS_SHADE;
- }
-
+ }
+
if (META_WINDOW_ALLOWS_MOVE (frame->window))
flags |= META_FRAME_ALLOWS_MOVE;
@@ -266,7 +266,7 @@ meta_frame_get_flags (MetaFrame *frame)
if (META_WINDOW_ALLOWS_VERTICAL_RESIZE (frame->window))
flags |= META_FRAME_ALLOWS_VERTICAL_RESIZE;
-
+
if (frame->window->has_focus)
flags |= META_FRAME_HAS_FOCUS;
@@ -290,7 +290,7 @@ meta_frame_get_flags (MetaFrame *frame)
if (frame->window->wm_state_above)
flags |= META_FRAME_ABOVE;
-
+
return flags;
}
@@ -309,7 +309,7 @@ meta_frame_calc_geometry (MetaFrame *frame,
&geom.bottom_height,
&geom.left_width,
&geom.right_width);
-
+
*geomp = geom;
}
@@ -365,7 +365,7 @@ meta_frame_sync_to_window (MetaFrame *frame,
* shaped, which might be more visible.
*/
update_shape (frame);
-
+
meta_ui_move_resize_frame (frame->window->screen->ui,
frame->xwindow,
frame->rect.x,
@@ -406,7 +406,7 @@ meta_frame_set_screen_cursor (MetaFrame *frame,
if (cursor == META_CURSOR_DEFAULT)
XUndefineCursor (frame->window->display->xdisplay, frame->xwindow);
else
- {
+ {
xcursor = meta_display_create_x_cursor (frame->window->display, cursor);
XDefineCursor (frame->window->display->xdisplay, frame->xwindow, xcursor);
XFlush (frame->window->display->xdisplay);