Remove trailing whitespace

This commit is contained in:
Jasper St. Pierre 2014-05-02 09:34:02 -04:00
parent 730ed6f75f
commit 25a16c3379
87 changed files with 2061 additions and 2061 deletions

View File

@ -179,7 +179,7 @@ decode_display_parameters (const uchar *edid, MonitorInfo *info)
else if (edid[0x16] == 0) else if (edid[0x16] == 0)
{ {
info->width_mm = -1; info->width_mm = -1;
info->height_mm = -1; info->height_mm = -1;
info->aspect_ratio = 100.0 / (edid[0x15] + 99); info->aspect_ratio = 100.0 / (edid[0x15] + 99);
} }
else if (edid[0x15] == 0) else if (edid[0x15] == 0)
@ -267,7 +267,7 @@ decode_color_characteristics (const uchar *edid, MonitorInfo *info)
static int static int
decode_established_timings (const uchar *edid, MonitorInfo *info) decode_established_timings (const uchar *edid, MonitorInfo *info)
{ {
static const Timing established[][8] = static const Timing established[][8] =
{ {
{ {
{ 800, 600, 60 }, { 800, 600, 60 },

View File

@ -1,9 +1,9 @@
/* edid.h /* edid.h
* *
* Copyright 2007, 2008, Red Hat, Inc. * Copyright 2007, 2008, Red Hat, Inc.
* *
* This file is part of the Gnome Library. * This file is part of the Gnome Library.
* *
* The Gnome Library is free software; you can redistribute it and/or * The Gnome Library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public License as * modify it under the terms of the GNU Library General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -13,12 +13,12 @@
* but WITHOUT ANY WARRANTY; without even the implied warranty of * but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details. * Library General Public License for more details.
* *
* You should have received a copy of the GNU Library General Public * You should have received a copy of the GNU Library General Public
* License along with the Gnome Library; see the file COPYING.LIB. If not, * License along with the Gnome Library; see the file COPYING.LIB. If not,
* write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
* *
* Author: Soren Sandmann <sandmann@redhat.com> * Author: Soren Sandmann <sandmann@redhat.com>
*/ */
@ -177,7 +177,7 @@ struct MonitorInfo
DetailedTiming detailed_timings[4]; /* If monitor has a preferred DetailedTiming detailed_timings[4]; /* If monitor has a preferred
* mode, it is the first one * mode, it is the first one
* (whether it has, is * (whether it has, is
* determined by the * determined by the
* preferred_timing_includes * preferred_timing_includes
* bit. * bit.
*/ */

View File

@ -53,7 +53,7 @@ struct _MetaCursorTracker {
MetaCursorReference *grab_cursor; MetaCursorReference *grab_cursor;
/* Wayland clients can set a NULL buffer as their cursor /* Wayland clients can set a NULL buffer as their cursor
* explicitly, which means that we shouldn't display anything. * explicitly, which means that we shouldn't display anything.
* So, we can't simply store a NULL in window_cursor to * So, we can't simply store a NULL in window_cursor to
* determine an unset window cursor; we need an extra boolean. * determine an unset window cursor; we need an extra boolean.

View File

@ -1,8 +1,8 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright 2013 Red Hat, Inc. * Copyright 2013 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
* *

View File

@ -1,7 +1,7 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2013 Red Hat Inc. * Copyright (C) 2013 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -11,7 +11,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -1,8 +1,8 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright 2013 Red Hat, Inc. * Copyright 2013 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
* *

View File

@ -1,8 +1,8 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright 2013 Red Hat, Inc. * Copyright 2013 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
* *

View File

@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001, 2002 Havoc Pennington * Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc. * Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2, * Some ICCCM manager selection code derived from fvwm2,
@ -8,7 +8,7 @@
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc. * Copyright (C) 2013 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -18,7 +18,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -570,7 +570,7 @@ is_all_whitespace (const char *text,
gsize text_len) gsize text_len)
{ {
gsize i; gsize i;
for (i = 0; i < text_len; i++) for (i = 0; i < text_len; i++)
if (!g_ascii_isspace (text[i])) if (!g_ascii_isspace (text[i]))
return FALSE; return FALSE;

View File

@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001, 2002 Havoc Pennington * Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc. * Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2, * Some ICCCM manager selection code derived from fvwm2,
@ -8,7 +8,7 @@
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc. * Copyright (C) 2013 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -18,7 +18,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -852,7 +852,7 @@ meta_monitor_manager_handle_apply_configuration (MetaDBusDisplayConfig *skeleto
/* If we were in progress of making a persistent change and we see a /* If we were in progress of making a persistent change and we see a
new request, it's likely that the old one failed in some way, so new request, it's likely that the old one failed in some way, so
don't save it, but also don't queue for restoring it. don't save it, but also don't queue for restoring it.
*/ */
if (manager->persistent_timeout_id && persistent) if (manager->persistent_timeout_id && persistent)
{ {
g_source_remove (manager->persistent_timeout_id); g_source_remove (manager->persistent_timeout_id);

View File

@ -12,12 +12,12 @@
* at MetaScreen instead. * at MetaScreen instead.
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc. * Copyright (C) 2013 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -27,7 +27,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -1,8 +1,8 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2013 Red Hat Inc. * Copyright (C) 2013 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

View File

@ -108,7 +108,7 @@ weston_launch_allowed(struct weston_launch *wl)
} }
free(session); free(session);
} }
return 0; return 0;
} }
@ -117,7 +117,7 @@ setup_launcher_socket(struct weston_launch *wl)
{ {
if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, wl->sock) < 0) if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, wl->sock) < 0)
error(1, errno, "socketpair failed"); error(1, errno, "socketpair failed");
fcntl(wl->sock[0], F_SETFD, O_CLOEXEC); fcntl(wl->sock[0], F_SETFD, O_CLOEXEC);
return 0; return 0;
@ -640,7 +640,7 @@ main(int argc, char *argv[])
{ "verbose", no_argument, NULL, 'v' }, { "verbose", no_argument, NULL, 'v' },
{ "help", no_argument, NULL, 'h' }, { "help", no_argument, NULL, 'h' },
{ 0, 0, NULL, 0 } { 0, 0, NULL, 0 }
}; };
memset(&wl, 0, sizeof wl); memset(&wl, 0, sizeof wl);
wl.drm_fd = -1; wl.drm_fd = -1;

View File

@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001, 2002 Havoc Pennington * Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc. * Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2, * Some ICCCM manager selection code derived from fvwm2,
@ -8,7 +8,7 @@
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* Copyright (C) 2013 Red Hat Inc. * Copyright (C) 2013 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -18,7 +18,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -272,7 +272,7 @@ get_edid_property (Display *dpy,
} }
XFree (prop); XFree (prop);
return result; return result;
} }

View File

@ -555,10 +555,10 @@ meta_compositor_manage (MetaCompositor *compositor)
meta_empty_stage_input_region (screen); meta_empty_stage_input_region (screen);
/* Make sure there isn't any left-over output shape on the /* Make sure there isn't any left-over output shape on the
* overlay window by setting the whole screen to be an * overlay window by setting the whole screen to be an
* output region. * output region.
* *
* Note: there doesn't seem to be any real chance of that * Note: there doesn't seem to be any real chance of that
* because the X server will destroy the overlay window * because the X server will destroy the overlay window
* when the last client using it exits. * when the last client using it exits.
@ -746,9 +746,9 @@ meta_compositor_window_surface_changed (MetaCompositor *compositor,
/** /**
* meta_compositor_process_event: (skip) * meta_compositor_process_event: (skip)
* @compositor: * @compositor:
* @event: * @event:
* @window: * @window:
* *
*/ */
gboolean gboolean

View File

@ -121,7 +121,7 @@ meta_region_builder_finish (MetaRegionBuilder *builder)
return result; return result;
} }
/* MetaRegionIterator */ /* MetaRegionIterator */
@ -171,7 +171,7 @@ meta_region_iterator_next (MetaRegionIterator *iter)
iter->line_end = TRUE; iter->line_end = TRUE;
} }
} }
static void static void
add_expanded_rect (MetaRegionBuilder *builder, add_expanded_rect (MetaRegionBuilder *builder,
int x, int x,

View File

@ -2,10 +2,10 @@
/* Mutter visual bell */ /* Mutter visual bell */
/* /*
* Copyright (C) 2002 Sun Microsystems Inc. * Copyright (C) 2002 Sun Microsystems Inc.
* Copyright (C) 2005, 2006 Elijah Newren * Copyright (C) 2005, 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -71,7 +71,7 @@
*/ */
#ifdef HAVE_XKB #ifdef HAVE_XKB
static void static void
bell_flash_fullscreen (MetaDisplay *display, bell_flash_fullscreen (MetaDisplay *display,
XkbAnyEvent *xkb_ev) XkbAnyEvent *xkb_ev)
{ {
g_assert (xkb_ev->xkb_type == XkbBellNotify); g_assert (xkb_ev->xkb_type == XkbBellNotify);
@ -96,7 +96,7 @@ bell_flash_fullscreen (MetaDisplay *display,
* Bug: This is the parallel to bell_flash_window_frame(), so it should * Bug: This is the parallel to bell_flash_window_frame(), so it should
* really be called meta_bell_unflash_window_frame(). * really be called meta_bell_unflash_window_frame().
*/ */
static gboolean static gboolean
bell_unflash_frame (gpointer data) bell_unflash_frame (gpointer data)
{ {
MetaFrame *frame = (MetaFrame *) data; MetaFrame *frame = (MetaFrame *) data;
@ -143,12 +143,12 @@ bell_flash_window_frame (MetaWindow *window)
* flashes the screen. * flashes the screen.
*/ */
static void static void
bell_flash_frame (MetaDisplay *display, bell_flash_frame (MetaDisplay *display,
XkbAnyEvent *xkb_ev) XkbAnyEvent *xkb_ev)
{ {
XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent *) xkb_ev; XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent *) xkb_ev;
MetaWindow *window; MetaWindow *window;
g_assert (xkb_ev->xkb_type == XkbBellNotify); g_assert (xkb_ev->xkb_type == XkbBellNotify);
window = meta_display_lookup_x_window (display, xkb_bell_event->window); window = meta_display_lookup_x_window (display, xkb_bell_event->window);
if (!window && (display->focus_window)) if (!window && (display->focus_window))
@ -180,10 +180,10 @@ bell_flash_frame (MetaDisplay *display,
* Bug: This should be merged with meta_bell_notify(). * Bug: This should be merged with meta_bell_notify().
*/ */
static void static void
bell_visual_notify (MetaDisplay *display, bell_visual_notify (MetaDisplay *display,
XkbAnyEvent *xkb_ev) XkbAnyEvent *xkb_ev)
{ {
switch (meta_prefs_get_visual_bell_type ()) switch (meta_prefs_get_visual_bell_type ())
{ {
case G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH: case G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH:
bell_flash_fullscreen (display, xkb_ev); bell_flash_fullscreen (display, xkb_ev);
@ -195,7 +195,7 @@ bell_visual_notify (MetaDisplay *display,
} }
void void
meta_bell_notify (MetaDisplay *display, meta_bell_notify (MetaDisplay *display,
XkbAnyEvent *xkb_ev) XkbAnyEvent *xkb_ev)
{ {
/* flash something */ /* flash something */
@ -271,19 +271,19 @@ meta_bell_init (MetaDisplay *display)
#ifdef HAVE_XKB #ifdef HAVE_XKB
int xkb_base_error_type, xkb_opcode; int xkb_base_error_type, xkb_opcode;
if (!XkbQueryExtension (display->xdisplay, &xkb_opcode, if (!XkbQueryExtension (display->xdisplay, &xkb_opcode,
&display->xkb_base_event_type, &display->xkb_base_event_type,
&xkb_base_error_type, &xkb_base_error_type,
NULL, NULL)) NULL, NULL))
{ {
display->xkb_base_event_type = -1; display->xkb_base_event_type = -1;
g_message ("could not find XKB extension."); g_message ("could not find XKB extension.");
return FALSE; return FALSE;
} }
else else
{ {
unsigned int mask = XkbBellNotifyMask; unsigned int mask = XkbBellNotifyMask;
gboolean visual_bell_auto_reset = FALSE; gboolean visual_bell_auto_reset = FALSE;
/* TRUE if and when non-broken version is available */ /* TRUE if and when non-broken version is available */
XkbSelectEvents (display->xdisplay, XkbSelectEvents (display->xdisplay,
XkbUseCoreKbd, XkbUseCoreKbd,
@ -326,6 +326,6 @@ meta_bell_shutdown (MetaDisplay *display)
void void
meta_bell_notify_frame_destroy (MetaFrame *frame) meta_bell_notify_frame_destroy (MetaFrame *frame)
{ {
if (frame->is_flashing) if (frame->is_flashing)
g_source_remove_by_funcs_user_data (&g_timeout_funcs, frame); g_source_remove_by_funcs_user_data (&g_timeout_funcs, frame);
} }

View File

@ -1,8 +1,8 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2002 Sun Microsystems Inc. * Copyright (C) 2002 Sun Microsystems Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -28,7 +28,7 @@
/** /**
* meta_bell_notify: * meta_bell_notify:
* @display: The display the bell event came in on * @display: The display the bell event came in on
* @xkb_ev: The bell event we just received * @xkb_ev: The bell event we just received
* *
* Gives the user some kind of visual bell; in fact, this is our response * Gives the user some kind of visual bell; in fact, this is our response
* to any kind of bell request, but we set it up so that we only get * to any kind of bell request, but we set it up so that we only get

View File

@ -2,9 +2,9 @@
/* Simple box operations */ /* Simple box operations */
/* /*
* Copyright (C) 2005, 2006 Elijah Newren * Copyright (C) 2005, 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -43,7 +43,7 @@ typedef enum
* region_to_string: (RECT_LENGTH+strlen(separator_string)) * * region_to_string: (RECT_LENGTH+strlen(separator_string)) *
* g_list_length (region) * g_list_length (region)
* edge_to_string: EDGE_LENGTH * edge_to_string: EDGE_LENGTH
* edge_list_to_...: (EDGE_LENGTH+strlen(separator_string)) * * edge_list_to_...: (EDGE_LENGTH+strlen(separator_string)) *
* g_list_length (edge_list) * g_list_length (edge_list)
*/ */
#define RECT_LENGTH 27 #define RECT_LENGTH 27
@ -181,7 +181,7 @@ void meta_rectangle_find_linepoint_closest_to_point (double x1, double y1,
/* Return whether an edge overlaps or is adjacent to the rectangle in the /* Return whether an edge overlaps or is adjacent to the rectangle in the
* nonzero-width dimension of the edge. * nonzero-width dimension of the edge.
*/ */
gboolean meta_rectangle_edge_aligns (const MetaRectangle *rect, gboolean meta_rectangle_edge_aligns (const MetaRectangle *rect,
const MetaEdge *edge); const MetaEdge *edge);
/* Compare two edges, so that sorting functions can put a list of edges in /* Compare two edges, so that sorting functions can put a list of edges in

View File

@ -6,14 +6,14 @@
* @Short_Description: Simple box operations * @Short_Description: Simple box operations
*/ */
/* /*
* Copyright (C) 2005, 2006 Elijah Newren * Copyright (C) 2005, 2006 Elijah Newren
* [meta_rectangle_intersect() is copyright the GTK+ Team according to Havoc, * [meta_rectangle_intersect() is copyright the GTK+ Team according to Havoc,
* see gdkrectangle.c. As far as Havoc knows, he probably wrote * see gdkrectangle.c. As far as Havoc knows, he probably wrote
* meta_rectangle_equal(), and I'm guessing it's (C) Red Hat. So...] * meta_rectangle_equal(), and I'm guessing it's (C) Red Hat. So...]
* Copyright (C) 1995-2000 GTK+ Team * Copyright (C) 1995-2000 GTK+ Team
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -23,7 +23,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -69,7 +69,7 @@ meta_rectangle_to_string (const MetaRectangle *rect,
* Should be more than enough space. Note that of this space, the * Should be more than enough space. Note that of this space, the
* trailing \0 will be overwritten for all but the last rectangle. * trailing \0 will be overwritten for all but the last rectangle.
*/ */
g_snprintf (output, RECT_LENGTH, "%d,%d +%d,%d", g_snprintf (output, RECT_LENGTH, "%d,%d +%d,%d",
rect->x, rect->y, rect->width, rect->height); rect->x, rect->y, rect->width, rect->height);
return output; return output;
@ -96,7 +96,7 @@ meta_rectangle_region_to_string (GList *region,
while (tmp) while (tmp)
{ {
MetaRectangle *rect = tmp->data; MetaRectangle *rect = tmp->data;
g_snprintf (rect_string, RECT_LENGTH, "[%d,%d +%d,%d]", g_snprintf (rect_string, RECT_LENGTH, "[%d,%d +%d,%d]",
rect->x, rect->y, rect->width, rect->height); rect->x, rect->y, rect->width, rect->height);
cur = g_stpcpy (cur, rect_string); cur = g_stpcpy (cur, rect_string);
tmp = tmp->next; tmp = tmp->next;
@ -118,7 +118,7 @@ meta_rectangle_edge_to_string (const MetaEdge *edge,
* Plus 2 for parenthesis, 4 for 2 more numbers, 2 more commas, and * Plus 2 for parenthesis, 4 for 2 more numbers, 2 more commas, and
* 2 more spaces, for a total of 10 more. * 2 more spaces, for a total of 10 more.
*/ */
g_snprintf (output, EDGE_LENGTH, "[%d,%d +%d,%d], %2d, %2d", g_snprintf (output, EDGE_LENGTH, "[%d,%d +%d,%d], %2d, %2d",
edge->rect.x, edge->rect.y, edge->rect.width, edge->rect.height, edge->rect.x, edge->rect.y, edge->rect.width, edge->rect.height,
edge->side_type, edge->edge_type); edge->side_type, edge->edge_type);
@ -150,7 +150,7 @@ meta_rectangle_edge_list_to_string (GList *edge_list,
{ {
MetaEdge *edge = tmp->data; MetaEdge *edge = tmp->data;
MetaRectangle *rect = &edge->rect; MetaRectangle *rect = &edge->rect;
g_snprintf (rect_string, EDGE_LENGTH, "([%d,%d +%d,%d], %2d, %2d)", g_snprintf (rect_string, EDGE_LENGTH, "([%d,%d +%d,%d], %2d, %2d)",
rect->x, rect->y, rect->width, rect->height, rect->x, rect->y, rect->width, rect->height,
edge->side_type, edge->edge_type); edge->side_type, edge->edge_type);
cur = g_stpcpy (cur, rect_string); cur = g_stpcpy (cur, rect_string);
@ -210,7 +210,7 @@ meta_rectangle_intersect (const MetaRectangle *src1,
dest_y = MAX (src1->y, src2->y); dest_y = MAX (src1->y, src2->y);
dest_w = MIN (src1->x + src1->width, src2->x + src2->width) - dest_x; dest_w = MIN (src1->x + src1->width, src2->x + src2->width) - dest_x;
dest_h = MIN (src1->y + src1->height, src2->y + src2->height) - dest_y; dest_h = MIN (src1->y + src1->height, src2->y + src2->height) - dest_y;
if (dest_w > 0 && dest_h > 0) if (dest_w > 0 && dest_h > 0)
{ {
dest->x = dest_x; dest->x = dest_x;
@ -320,7 +320,7 @@ gboolean
meta_rectangle_contains_rect (const MetaRectangle *outer_rect, meta_rectangle_contains_rect (const MetaRectangle *outer_rect,
const MetaRectangle *inner_rect) const MetaRectangle *inner_rect)
{ {
return return
inner_rect->x >= outer_rect->x && inner_rect->x >= outer_rect->x &&
inner_rect->y >= outer_rect->y && inner_rect->y >= outer_rect->y &&
inner_rect->x + inner_rect->width <= outer_rect->x + outer_rect->width && inner_rect->x + inner_rect->width <= outer_rect->x + outer_rect->width &&
@ -339,7 +339,7 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
* boxes.h has a good comment, but I'm not sure if the below info is also * boxes.h has a good comment, but I'm not sure if the below info is also
* helpful on top of that (or whether it has superfluous info). * helpful on top of that (or whether it has superfluous info).
*/ */
/* These formulas may look overly simplistic at first but you can work /* These formulas may look overly simplistic at first but you can work
* everything out with a left_frame_with, right_frame_width, * everything out with a left_frame_with, right_frame_width,
* border_width, and old and new client area widths (instead of old total * border_width, and old and new client area widths (instead of old total
@ -389,7 +389,7 @@ meta_rectangle_resize_with_gravity (const MetaRectangle *old_rect,
break; break;
} }
rect->width = new_width; rect->width = new_width;
/* Next, the y direction */ /* Next, the y direction */
switch (gravity) switch (gravity)
{ {
@ -629,7 +629,7 @@ meta_rectangle_get_minimal_spanning_set_for_region (
for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next) for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next)
{ {
GList *rect_iter; GList *rect_iter;
MetaRectangle *strut_rect = &((MetaStrut*)strut_iter->data)->rect; MetaRectangle *strut_rect = &((MetaStrut*)strut_iter->data)->rect;
tmp_list = ret; tmp_list = ret;
@ -764,7 +764,7 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect,
*/ */
g_assert ((direction == META_DIRECTION_HORIZONTAL) ^ g_assert ((direction == META_DIRECTION_HORIZONTAL) ^
(direction == META_DIRECTION_VERTICAL )); (direction == META_DIRECTION_VERTICAL ));
if (direction == META_DIRECTION_HORIZONTAL) if (direction == META_DIRECTION_HORIZONTAL)
{ {
rect->x = expand_to->x; rect->x = expand_to->x;
@ -776,12 +776,12 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect,
rect->height = expand_to->height; rect->height = expand_to->height;
} }
/* Run over all struts */ /* Run over all struts */
for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next) for (strut_iter = all_struts; strut_iter; strut_iter = strut_iter->next)
{ {
MetaStrut *strut = (MetaStrut*) strut_iter->data; MetaStrut *strut = (MetaStrut*) strut_iter->data;
/* Skip struts that don't overlap */ /* Skip struts that don't overlap */
if (!meta_rectangle_overlap (&strut->rect, rect)) if (!meta_rectangle_overlap (&strut->rect, rect))
continue; continue;
@ -822,7 +822,7 @@ meta_rectangle_expand_to_avoiding_struts (MetaRectangle *rect,
void void
meta_rectangle_free_list_and_elements (GList *filled_list) meta_rectangle_free_list_and_elements (GList *filled_list)
{ {
g_list_foreach (filled_list, g_list_foreach (filled_list,
(void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */ (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
NULL); NULL);
g_list_free (filled_list); g_list_free (filled_list);
@ -900,20 +900,20 @@ meta_rectangle_clamp_to_fit_into_region (const GList *spanning_rects,
{ {
MetaRectangle *compare_rect = temp->data; MetaRectangle *compare_rect = temp->data;
int maximal_overlap_amount_for_compare; int maximal_overlap_amount_for_compare;
/* If x is fixed and the entire width of rect doesn't fit in compare, /* If x is fixed and the entire width of rect doesn't fit in compare,
* skip this rectangle. * skip this rectangle.
*/ */
if ((fixed_directions & FIXED_DIRECTION_X) && if ((fixed_directions & FIXED_DIRECTION_X) &&
(compare_rect->x > rect->x || (compare_rect->x > rect->x ||
compare_rect->x + compare_rect->width < rect->x + rect->width)) compare_rect->x + compare_rect->width < rect->x + rect->width))
continue; continue;
/* If y is fixed and the entire height of rect doesn't fit in compare, /* If y is fixed and the entire height of rect doesn't fit in compare,
* skip this rectangle. * skip this rectangle.
*/ */
if ((fixed_directions & FIXED_DIRECTION_Y) && if ((fixed_directions & FIXED_DIRECTION_Y) &&
(compare_rect->y > rect->y || (compare_rect->y > rect->y ||
compare_rect->y + compare_rect->height < rect->y + rect->height)) compare_rect->y + compare_rect->height < rect->y + rect->height))
continue; continue;
@ -970,20 +970,20 @@ meta_rectangle_clip_to_region (const GList *spanning_rects,
MetaRectangle *compare_rect = temp->data; MetaRectangle *compare_rect = temp->data;
MetaRectangle overlap; MetaRectangle overlap;
int maximal_overlap_amount_for_compare; int maximal_overlap_amount_for_compare;
/* If x is fixed and the entire width of rect doesn't fit in compare, /* If x is fixed and the entire width of rect doesn't fit in compare,
* skip the rectangle. * skip the rectangle.
*/ */
if ((fixed_directions & FIXED_DIRECTION_X) && if ((fixed_directions & FIXED_DIRECTION_X) &&
(compare_rect->x > rect->x || (compare_rect->x > rect->x ||
compare_rect->x + compare_rect->width < rect->x + rect->width)) compare_rect->x + compare_rect->width < rect->x + rect->width))
continue; continue;
/* If y is fixed and the entire height of rect doesn't fit in compare, /* If y is fixed and the entire height of rect doesn't fit in compare,
* skip the rectangle. * skip the rectangle.
*/ */
if ((fixed_directions & FIXED_DIRECTION_Y) && if ((fixed_directions & FIXED_DIRECTION_Y) &&
(compare_rect->y > rect->y || (compare_rect->y > rect->y ||
compare_rect->y + compare_rect->height < rect->y + rect->height)) compare_rect->y + compare_rect->height < rect->y + rect->height))
continue; continue;
@ -1043,26 +1043,26 @@ meta_rectangle_shove_into_region (const GList *spanning_rects,
/* First, find best rectangle from spanning_rects to which we will shove /* First, find best rectangle from spanning_rects to which we will shove
* rect into. * rect into.
*/ */
for (temp = spanning_rects; temp; temp = temp->next) for (temp = spanning_rects; temp; temp = temp->next)
{ {
MetaRectangle *compare_rect = temp->data; MetaRectangle *compare_rect = temp->data;
int maximal_overlap_amount_for_compare; int maximal_overlap_amount_for_compare;
int dist_to_compare; int dist_to_compare;
/* If x is fixed and the entire width of rect doesn't fit in compare, /* If x is fixed and the entire width of rect doesn't fit in compare,
* skip this rectangle. * skip this rectangle.
*/ */
if ((fixed_directions & FIXED_DIRECTION_X) && if ((fixed_directions & FIXED_DIRECTION_X) &&
(compare_rect->x > rect->x || (compare_rect->x > rect->x ||
compare_rect->x + compare_rect->width < rect->x + rect->width)) compare_rect->x + compare_rect->width < rect->x + rect->width))
continue; continue;
/* If y is fixed and the entire height of rect doesn't fit in compare, /* If y is fixed and the entire height of rect doesn't fit in compare,
* skip this rectangle. * skip this rectangle.
*/ */
if ((fixed_directions & FIXED_DIRECTION_Y) && if ((fixed_directions & FIXED_DIRECTION_Y) &&
(compare_rect->y > rect->y || (compare_rect->y > rect->y ||
compare_rect->y + compare_rect->height < rect->y + rect->height)) compare_rect->y + compare_rect->height < rect->y + rect->height))
continue; continue;
@ -1218,7 +1218,7 @@ meta_rectangle_edge_aligns (const MetaRectangle *rect, const MetaEdge *edge)
} }
static GList* static GList*
get_rect_minus_overlap (const GList *rect_in_list, get_rect_minus_overlap (const GList *rect_in_list,
MetaRectangle *overlap) MetaRectangle *overlap)
{ {
MetaRectangle *temp; MetaRectangle *temp;
@ -1263,7 +1263,7 @@ get_rect_minus_overlap (const GList *rect_in_list,
} }
static GList* static GList*
replace_rect_with_list (GList *old_element, replace_rect_with_list (GList *old_element,
GList *new_list) GList *new_list)
{ {
GList *ret; GList *ret;
@ -1475,7 +1475,7 @@ rectangle_and_edge_intersection (const MetaRectangle *rect,
overlap->edge_type = -1; overlap->edge_type = -1;
overlap->side_type = -1; overlap->side_type = -1;
/* Figure out what the intersection is */ /* Figure out what the intersection is */
result->x = MAX (rect->x, rect2->x); result->x = MAX (rect->x, rect2->x);
result->y = MAX (rect->y, rect2->y); result->y = MAX (rect->y, rect2->y);
result->width = MIN (BOX_RIGHT (*rect), BOX_RIGHT (*rect2)) - result->x; result->width = MIN (BOX_RIGHT (*rect), BOX_RIGHT (*rect2)) - result->x;
@ -1546,7 +1546,7 @@ rectangle_and_edge_intersection (const MetaRectangle *rect,
* TOP<->BOTTOM). * TOP<->BOTTOM).
*/ */
static GList* static GList*
add_edges (GList *cur_edges, add_edges (GList *cur_edges,
const MetaRectangle *rect, const MetaRectangle *rect,
gboolean rect_is_internal) gboolean rect_is_internal)
{ {
@ -1560,23 +1560,23 @@ add_edges (GList *cur_edges,
switch (i) switch (i)
{ {
case 0: case 0:
temp_edge->side_type = temp_edge->side_type =
rect_is_internal ? META_SIDE_LEFT : META_SIDE_RIGHT; rect_is_internal ? META_SIDE_LEFT : META_SIDE_RIGHT;
temp_edge->rect.width = 0; temp_edge->rect.width = 0;
break; break;
case 1: case 1:
temp_edge->side_type = temp_edge->side_type =
rect_is_internal ? META_SIDE_RIGHT : META_SIDE_LEFT; rect_is_internal ? META_SIDE_RIGHT : META_SIDE_LEFT;
temp_edge->rect.x += temp_edge->rect.width; temp_edge->rect.x += temp_edge->rect.width;
temp_edge->rect.width = 0; temp_edge->rect.width = 0;
break; break;
case 2: case 2:
temp_edge->side_type = temp_edge->side_type =
rect_is_internal ? META_SIDE_TOP : META_SIDE_BOTTOM; rect_is_internal ? META_SIDE_TOP : META_SIDE_BOTTOM;
temp_edge->rect.height = 0; temp_edge->rect.height = 0;
break; break;
case 3: case 3:
temp_edge->side_type = temp_edge->side_type =
rect_is_internal ? META_SIDE_BOTTOM : META_SIDE_TOP; rect_is_internal ? META_SIDE_BOTTOM : META_SIDE_TOP;
temp_edge->rect.y += temp_edge->rect.height; temp_edge->rect.y += temp_edge->rect.height;
temp_edge->rect.height = 0; temp_edge->rect.height = 0;
@ -1593,8 +1593,8 @@ add_edges (GList *cur_edges,
* edges to cur_list. Return cur_list when finished. * edges to cur_list. Return cur_list when finished.
*/ */
static GList* static GList*
split_edge (GList *cur_list, split_edge (GList *cur_list,
const MetaEdge *old_edge, const MetaEdge *old_edge,
const MetaEdge *remove) const MetaEdge *remove)
{ {
MetaEdge *temp_edge; MetaEdge *temp_edge;
@ -1653,7 +1653,7 @@ split_edge (GList *cur_list,
* if and how rect and edge intersect. * if and how rect and edge intersect.
*/ */
static void static void
fix_up_edges (MetaRectangle *rect, MetaEdge *edge, fix_up_edges (MetaRectangle *rect, MetaEdge *edge,
GList **strut_edges, GList **edge_splits, GList **strut_edges, GList **edge_splits,
gboolean *edge_needs_removal) gboolean *edge_needs_removal)
{ {
@ -1777,7 +1777,7 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
{ {
GList *ret; GList *ret;
GList *fixed_strut_rects; GList *fixed_strut_rects;
GList *edge_iter; GList *edge_iter;
const GList *strut_rect_iter; const GList *strut_rect_iter;
/* The algorithm is basically as follows: /* The algorithm is basically as follows:
@ -1817,7 +1817,7 @@ meta_rectangle_find_onscreen_edges (const MetaRectangle *basic_rect,
GList *splits_of_cur_edge = NULL; GList *splits_of_cur_edge = NULL;
gboolean edge_needs_removal = FALSE; gboolean edge_needs_removal = FALSE;
fix_up_edges (strut_rect, cur_edge, fix_up_edges (strut_rect, cur_edge,
&new_strut_edges, &splits_of_cur_edge, &new_strut_edges, &splits_of_cur_edge,
&edge_needs_removal); &edge_needs_removal);
@ -1981,7 +1981,7 @@ meta_rectangle_find_nonintersected_monitor_edges (
for (; all_struts; all_struts = all_struts->next) for (; all_struts; all_struts = all_struts->next)
temp_rects = g_slist_prepend (temp_rects, temp_rects = g_slist_prepend (temp_rects,
&((MetaStrut*)all_struts->data)->rect); &((MetaStrut*)all_struts->data)->rect);
ret = meta_rectangle_remove_intersections_with_boxes_from_edges (ret, ret = meta_rectangle_remove_intersections_with_boxes_from_edges (ret,
temp_rects); temp_rects);
g_slist_free (temp_rects); g_slist_free (temp_rects);

View File

@ -42,7 +42,7 @@
// "constrain_whatever". // "constrain_whatever".
// 3) Add your function to the all_constraints and all_constraint_names // 3) Add your function to the all_constraints and all_constraint_names
// arrays (the latter of which is for debugging purposes) // arrays (the latter of which is for debugging purposes)
// //
// An example constraint function, constrain_whatever: // An example constraint function, constrain_whatever:
// //
// /* constrain_whatever does the following: // /* constrain_whatever does the following:
@ -246,7 +246,7 @@ do_all_constraints (MetaWindow *window,
/* Log how the constraint modified the position */ /* Log how the constraint modified the position */
meta_topic (META_DEBUG_GEOMETRY, meta_topic (META_DEBUG_GEOMETRY,
"info->current is %d,%d +%d,%d after %s\n", "info->current is %d,%d +%d,%d after %s\n",
info->current.x, info->current.y, info->current.x, info->current.y,
info->current.width, info->current.height, info->current.width, info->current.height,
constraint->name); constraint->name);
} }
@ -282,7 +282,7 @@ meta_window_constrain (MetaWindow *window,
new->x, new->y, new->width, new->height); new->x, new->y, new->width, new->height);
setup_constraint_info (&info, setup_constraint_info (&info,
window, window,
flags, flags,
resize_gravity, resize_gravity,
orig, orig,
@ -295,7 +295,7 @@ meta_window_constrain (MetaWindow *window,
/* Individually enforce all the high-enough priority constraints */ /* Individually enforce all the high-enough priority constraints */
do_all_constraints (window, &info, priority, !check_only); do_all_constraints (window, &info, priority, !check_only);
/* Check if all high-enough priority constraints are simultaneously /* Check if all high-enough priority constraints are simultaneously
* satisfied * satisfied
*/ */
satisfied = do_all_constraints (window, &info, priority, check_only); satisfied = do_all_constraints (window, &info, priority, check_only);
@ -398,10 +398,10 @@ setup_constraint_info (ConstraintInfo *info,
} }
cur_workspace = window->screen->active_workspace; cur_workspace = window->screen->active_workspace;
info->usable_screen_region = info->usable_screen_region =
meta_workspace_get_onscreen_region (cur_workspace); meta_workspace_get_onscreen_region (cur_workspace);
info->usable_monitor_region = info->usable_monitor_region =
meta_workspace_get_onmonitor_region (cur_workspace, meta_workspace_get_onmonitor_region (cur_workspace,
monitor_info->number); monitor_info->number);
/* Workaround braindead legacy apps that don't know how to /* Workaround braindead legacy apps that don't know how to
@ -441,7 +441,7 @@ setup_constraint_info (ConstraintInfo *info,
" work_area_monitor: %d,%d +%d,%d\n" " work_area_monitor: %d,%d +%d,%d\n"
" entire_monitor : %d,%d +%d,%d\n", " entire_monitor : %d,%d +%d,%d\n",
info->orig.x, info->orig.y, info->orig.width, info->orig.height, info->orig.x, info->orig.y, info->orig.width, info->orig.height,
info->current.x, info->current.y, info->current.x, info->current.y,
info->current.width, info->current.height, info->current.width, info->current.height,
(info->action_type == ACTION_MOVE) ? "Move" : (info->action_type == ACTION_MOVE) ? "Move" :
(info->action_type == ACTION_RESIZE) ? "Resize" : (info->action_type == ACTION_RESIZE) ? "Resize" :
@ -454,7 +454,7 @@ setup_constraint_info (ConstraintInfo *info,
(info->fixed_directions == FIXED_DIRECTION_Y) ? "Y fixed" : (info->fixed_directions == FIXED_DIRECTION_Y) ? "Y fixed" :
"Freakin' Invalid Stupid", "Freakin' Invalid Stupid",
info->work_area_monitor.x, info->work_area_monitor.y, info->work_area_monitor.x, info->work_area_monitor.y,
info->work_area_monitor.width, info->work_area_monitor.width,
info->work_area_monitor.height, info->work_area_monitor.height,
info->entire_monitor.x, info->entire_monitor.y, info->entire_monitor.x, info->entire_monitor.y,
info->entire_monitor.width, info->entire_monitor.height); info->entire_monitor.width, info->entire_monitor.height);
@ -502,8 +502,8 @@ place_window_if_needed(MetaWindow *window,
monitor_info->number, monitor_info->number,
&info->work_area_monitor); &info->work_area_monitor);
cur_workspace = window->screen->active_workspace; cur_workspace = window->screen->active_workspace;
info->usable_monitor_region = info->usable_monitor_region =
meta_workspace_get_onmonitor_region (cur_workspace, meta_workspace_get_onmonitor_region (cur_workspace,
monitor_info->number); monitor_info->number);
meta_window_frame_rect_to_client_rect (window, &placed_rect, &placed_rect); meta_window_frame_rect_to_client_rect (window, &placed_rect, &placed_rect);
@ -546,7 +546,7 @@ place_window_if_needed(MetaWindow *window,
if (window->maximize_horizontally_after_placement || if (window->maximize_horizontally_after_placement ||
window->maximize_vertically_after_placement) window->maximize_vertically_after_placement)
meta_window_maximize_internal (window, meta_window_maximize_internal (window,
(window->maximize_horizontally_after_placement ? (window->maximize_horizontally_after_placement ?
META_MAXIMIZE_HORIZONTAL : 0 ) | META_MAXIMIZE_HORIZONTAL : 0 ) |
(window->maximize_vertically_after_placement ? (window->maximize_vertically_after_placement ?
@ -631,7 +631,7 @@ update_onscreen_requirements (MetaWindow *window,
if (old ^ window->require_on_single_monitor) if (old ^ window->require_on_single_monitor)
meta_topic (META_DEBUG_GEOMETRY, meta_topic (META_DEBUG_GEOMETRY,
"require_on_single_monitor for %s toggled to %s\n", "require_on_single_monitor for %s toggled to %s\n",
window->desc, window->desc,
window->require_on_single_monitor ? "TRUE" : "FALSE"); window->require_on_single_monitor ? "TRUE" : "FALSE");
/* Update whether we want future constraint runs to require the /* Update whether we want future constraint runs to require the
@ -910,7 +910,7 @@ constrain_size_increments (MetaWindow *window,
return TRUE; return TRUE;
/* Determine whether constraint applies; exit if it doesn't */ /* Determine whether constraint applies; exit if it doesn't */
if (META_WINDOW_MAXIMIZED (window) || window->fullscreen || if (META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
META_WINDOW_TILED_SIDE_BY_SIDE (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) ||
info->action_type == ACTION_MOVE) info->action_type == ACTION_MOVE)
return TRUE; return TRUE;
@ -928,7 +928,7 @@ constrain_size_increments (MetaWindow *window,
if (window->maximized_vertically) if (window->maximized_vertically)
extra_height *= 0; extra_height *= 0;
/* constraint is satisfied iff there is no extra height or width */ /* constraint is satisfied iff there is no extra height or width */
constraint_already_satisfied = constraint_already_satisfied =
(extra_height == 0 && extra_width == 0); (extra_height == 0 && extra_width == 0);
if (check_only || constraint_already_satisfied) if (check_only || constraint_already_satisfied)
@ -954,10 +954,10 @@ constrain_size_increments (MetaWindow *window,
start_rect = &info->current; start_rect = &info->current;
else else
start_rect = &info->orig; start_rect = &info->orig;
/* Resize to the new size */ /* Resize to the new size */
meta_rectangle_resize_with_gravity (start_rect, meta_rectangle_resize_with_gravity (start_rect,
&info->current, &info->current,
info->resize_gravity, info->resize_gravity,
new_width, new_width,
new_height); new_height);
@ -1002,7 +1002,7 @@ constrain_size_limits (MetaWindow *window,
/*** Enforce constraint ***/ /*** Enforce constraint ***/
new_width = CLAMP (info->current.width, min_size.width, max_size.width); new_width = CLAMP (info->current.width, min_size.width, max_size.width);
new_height = CLAMP (info->current.height, min_size.height, max_size.height); new_height = CLAMP (info->current.height, min_size.height, max_size.height);
/* Figure out what original rect to pass to meta_rectangle_resize_with_gravity /* Figure out what original rect to pass to meta_rectangle_resize_with_gravity
* See bug 448183 * See bug 448183
*/ */
@ -1010,9 +1010,9 @@ constrain_size_limits (MetaWindow *window,
start_rect = &info->current; start_rect = &info->current;
else else
start_rect = &info->orig; start_rect = &info->orig;
meta_rectangle_resize_with_gravity (start_rect, meta_rectangle_resize_with_gravity (start_rect,
&info->current, &info->current,
info->resize_gravity, info->resize_gravity,
new_width, new_width,
new_height); new_height);
@ -1042,7 +1042,7 @@ constrain_aspect_ratio (MetaWindow *window,
(double)window->size_hints.max_aspect.y; (double)window->size_hints.max_aspect.y;
constraints_are_inconsistent = minr > maxr; constraints_are_inconsistent = minr > maxr;
if (constraints_are_inconsistent || if (constraints_are_inconsistent ||
META_WINDOW_MAXIMIZED (window) || window->fullscreen || META_WINDOW_MAXIMIZED (window) || window->fullscreen ||
META_WINDOW_TILED_SIDE_BY_SIDE (window) || META_WINDOW_TILED_SIDE_BY_SIDE (window) ||
info->action_type == ACTION_MOVE) info->action_type == ACTION_MOVE)
return TRUE; return TRUE;
@ -1082,7 +1082,7 @@ constrain_aspect_ratio (MetaWindow *window,
fudge = 1; fudge = 1;
break; break;
} }
constraint_already_satisfied = constraint_already_satisfied =
info->current.width - (info->current.height * minr ) > -minr*fudge && info->current.width - (info->current.height * minr ) > -minr*fudge &&
info->current.width - (info->current.height * maxr ) < maxr*fudge; info->current.width - (info->current.height * maxr ) < maxr*fudge;
if (check_only || constraint_already_satisfied) if (check_only || constraint_already_satisfied)
@ -1146,7 +1146,7 @@ constrain_aspect_ratio (MetaWindow *window,
start_rect = &info->orig; start_rect = &info->orig;
meta_rectangle_resize_with_gravity (start_rect, meta_rectangle_resize_with_gravity (start_rect,
&info->current, &info->current,
info->resize_gravity, info->resize_gravity,
new_width, new_width,
new_height); new_height);
@ -1194,7 +1194,7 @@ do_screen_and_monitor_relative_constraints (
exit_early = TRUE; exit_early = TRUE;
/* Determine whether constraint is already satisfied; exit if it is */ /* Determine whether constraint is already satisfied; exit if it is */
constraint_satisfied = constraint_satisfied =
meta_rectangle_contained_in_region (region_spanning_rectangles, meta_rectangle_contained_in_region (region_spanning_rectangles,
&info->current); &info->current);
if (exit_early || constraint_satisfied || check_only) if (exit_early || constraint_satisfied || check_only)
@ -1233,7 +1233,7 @@ constrain_to_single_monitor (MetaWindow *window,
return TRUE; return TRUE;
/* Exit early if we know the constraint won't apply--note that this constraint /* Exit early if we know the constraint won't apply--note that this constraint
* is only meant for normal windows (e.g. we don't want docks to be shoved * is only meant for normal windows (e.g. we don't want docks to be shoved
* "onscreen" by their own strut) and we can't apply it to frameless windows * "onscreen" by their own strut) and we can't apply it to frameless windows
* or else users will be unable to move windows such as XMMS across monitors. * or else users will be unable to move windows such as XMMS across monitors.
*/ */
@ -1246,7 +1246,7 @@ constrain_to_single_monitor (MetaWindow *window,
return TRUE; return TRUE;
/* Have a helper function handle the constraint for us */ /* Have a helper function handle the constraint for us */
return do_screen_and_monitor_relative_constraints (window, return do_screen_and_monitor_relative_constraints (window,
info->usable_monitor_region, info->usable_monitor_region,
info, info,
check_only); check_only);
@ -1262,18 +1262,18 @@ constrain_fully_onscreen (MetaWindow *window,
return TRUE; return TRUE;
/* Exit early if we know the constraint won't apply--note that this constraint /* Exit early if we know the constraint won't apply--note that this constraint
* is only meant for normal windows (e.g. we don't want docks to be shoved * is only meant for normal windows (e.g. we don't want docks to be shoved
* "onscreen" by their own strut). * "onscreen" by their own strut).
*/ */
if (window->type == META_WINDOW_DESKTOP || if (window->type == META_WINDOW_DESKTOP ||
window->type == META_WINDOW_DOCK || window->type == META_WINDOW_DOCK ||
window->fullscreen || window->fullscreen ||
!window->require_fully_onscreen || !window->require_fully_onscreen ||
info->is_user_action) info->is_user_action)
return TRUE; return TRUE;
/* Have a helper function handle the constraint for us */ /* Have a helper function handle the constraint for us */
return do_screen_and_monitor_relative_constraints (window, return do_screen_and_monitor_relative_constraints (window,
info->usable_screen_region, info->usable_screen_region,
info, info,
check_only); check_only);
@ -1301,7 +1301,7 @@ constrain_titlebar_visible (MetaWindow *window,
info->is_user_action && !window->display->grab_frame_action; info->is_user_action && !window->display->grab_frame_action;
/* Exit early if we know the constraint won't apply--note that this constraint /* Exit early if we know the constraint won't apply--note that this constraint
* is only meant for normal windows (e.g. we don't want docks to be shoved * is only meant for normal windows (e.g. we don't want docks to be shoved
* "onscreen" by their own strut). * "onscreen" by their own strut).
*/ */
if (window->type == META_WINDOW_DESKTOP || if (window->type == META_WINDOW_DESKTOP ||
@ -1345,13 +1345,13 @@ constrain_titlebar_visible (MetaWindow *window,
*/ */
meta_rectangle_expand_region_conditionally (info->usable_screen_region, meta_rectangle_expand_region_conditionally (info->usable_screen_region,
horiz_amount_offscreen, horiz_amount_offscreen,
horiz_amount_offscreen, horiz_amount_offscreen,
0, /* Don't let titlebar off */ 0, /* Don't let titlebar off */
bottom_amount, bottom_amount,
horiz_amount_onscreen, horiz_amount_onscreen,
vert_amount_onscreen); vert_amount_onscreen);
retval = retval =
do_screen_and_monitor_relative_constraints (window, do_screen_and_monitor_relative_constraints (window,
info->usable_screen_region, info->usable_screen_region,
info, info,
check_only); check_only);
@ -1381,7 +1381,7 @@ constrain_partially_onscreen (MetaWindow *window,
return TRUE; return TRUE;
/* Exit early if we know the constraint won't apply--note that this constraint /* Exit early if we know the constraint won't apply--note that this constraint
* is only meant for normal windows (e.g. we don't want docks to be shoved * is only meant for normal windows (e.g. we don't want docks to be shoved
* "onscreen" by their own strut). * "onscreen" by their own strut).
*/ */
if (window->type == META_WINDOW_DESKTOP || if (window->type == META_WINDOW_DESKTOP ||
@ -1423,13 +1423,13 @@ constrain_partially_onscreen (MetaWindow *window,
*/ */
meta_rectangle_expand_region_conditionally (info->usable_screen_region, meta_rectangle_expand_region_conditionally (info->usable_screen_region,
horiz_amount_offscreen, horiz_amount_offscreen,
horiz_amount_offscreen, horiz_amount_offscreen,
top_amount, top_amount,
bottom_amount, bottom_amount,
horiz_amount_onscreen, horiz_amount_onscreen,
vert_amount_onscreen); vert_amount_onscreen);
retval = retval =
do_screen_and_monitor_relative_constraints (window, do_screen_and_monitor_relative_constraints (window,
info->usable_screen_region, info->usable_screen_region,
info, info,
check_only); check_only);

View File

@ -2,10 +2,10 @@
/* Mutter size/position constraints */ /* Mutter size/position constraints */
/* /*
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,11 +2,11 @@
/* Mutter interface used by GTK+ UI to talk to core */ /* Mutter interface used by GTK+ UI to talk to core */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -46,7 +46,7 @@ get_window (Display *xdisplay,
{ {
MetaDisplay *display; MetaDisplay *display;
MetaWindow *window; MetaWindow *window;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
window = meta_display_lookup_x_window (display, frame_xwindow); window = meta_display_lookup_x_window (display, frame_xwindow);
@ -92,14 +92,14 @@ meta_core_get (Display *xdisplay,
} }
while (request != META_CORE_GET_END) { while (request != META_CORE_GET_END) {
gpointer answer = va_arg (args, gpointer); gpointer answer = va_arg (args, gpointer);
switch (request) { switch (request) {
case META_CORE_WINDOW_HAS_FRAME: case META_CORE_WINDOW_HAS_FRAME:
*((gboolean*)answer) = window != NULL && window->frame != NULL; *((gboolean*)answer) = window != NULL && window->frame != NULL;
if (!*((gboolean*)answer)) goto out; /* see above */ if (!*((gboolean*)answer)) goto out; /* see above */
break; break;
case META_CORE_GET_CLIENT_WIDTH: case META_CORE_GET_CLIENT_WIDTH:
*((gint*)answer) = window->rect.width; *((gint*)answer) = window->rect.width;
break; break;
@ -111,7 +111,7 @@ meta_core_get (Display *xdisplay,
break; break;
case META_CORE_GET_FRAME_FLAGS: case META_CORE_GET_FRAME_FLAGS:
*((MetaFrameFlags*)answer) = meta_frame_get_flags (window->frame); *((MetaFrameFlags*)answer) = meta_frame_get_flags (window->frame);
break; break;
case META_CORE_GET_FRAME_TYPE: case META_CORE_GET_FRAME_TYPE:
*((MetaFrameType*)answer) = meta_window_get_frame_type (window); *((MetaFrameType*)answer) = meta_window_get_frame_type (window);
break; break;
@ -157,7 +157,7 @@ meta_core_get (Display *xdisplay,
} }
request = va_arg (args, MetaCoreGetType); request = va_arg (args, MetaCoreGetType);
} }
out: out:
va_end (args); va_end (args);
@ -189,21 +189,21 @@ lower_window_and_transients (MetaWindow *window,
* (Borrowed from window.c.) * (Borrowed from window.c.)
*/ */
if (window->screen->active_workspace && if (window->screen->active_workspace &&
meta_window_located_on_workspace (window, meta_window_located_on_workspace (window,
window->screen->active_workspace)) window->screen->active_workspace))
{ {
GList* link; GList* link;
link = g_list_find (window->screen->active_workspace->mru_list, link = g_list_find (window->screen->active_workspace->mru_list,
window); window);
g_assert (link); g_assert (link);
window->screen->active_workspace->mru_list = window->screen->active_workspace->mru_list =
g_list_remove_link (window->screen->active_workspace->mru_list, g_list_remove_link (window->screen->active_workspace->mru_list,
link); link);
g_list_free (link); g_list_free (link);
window->screen->active_workspace->mru_list = window->screen->active_workspace->mru_list =
g_list_append (window->screen->active_workspace->mru_list, g_list_append (window->screen->active_workspace->mru_list,
window); window);
} }
} }
@ -235,7 +235,7 @@ meta_core_user_focus (Display *xdisplay,
guint32 timestamp) guint32 timestamp)
{ {
MetaWindow *window = get_window (xdisplay, frame_xwindow); MetaWindow *window = get_window (xdisplay, frame_xwindow);
meta_window_focus (window, timestamp); meta_window_focus (window, timestamp);
} }
@ -323,7 +323,7 @@ meta_core_delete (Display *xdisplay,
guint32 timestamp) guint32 timestamp)
{ {
MetaWindow *window = get_window (xdisplay, frame_xwindow); MetaWindow *window = get_window (xdisplay, frame_xwindow);
meta_window_delete (window, timestamp); meta_window_delete (window, timestamp);
} }
@ -343,7 +343,7 @@ meta_core_shade (Display *xdisplay,
guint32 timestamp) guint32 timestamp)
{ {
MetaWindow *window = get_window (xdisplay, frame_xwindow); MetaWindow *window = get_window (xdisplay, frame_xwindow);
meta_window_shade (window, timestamp); meta_window_shade (window, timestamp);
} }
@ -404,7 +404,7 @@ meta_core_show_window_menu (Display *xdisplay,
guint32 timestamp) guint32 timestamp)
{ {
MetaWindow *window = get_window (xdisplay, frame_xwindow); MetaWindow *window = get_window (xdisplay, frame_xwindow);
if (meta_prefs_get_raise_on_click ()) if (meta_prefs_get_raise_on_click ())
meta_window_raise (window); meta_window_raise (window);
meta_window_focus (window, timestamp); meta_window_focus (window, timestamp);
@ -421,7 +421,7 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
const char *name; const char *name;
name = NULL; name = NULL;
switch (menu_op) switch (menu_op)
{ {
case META_MENU_OP_NONE: case META_MENU_OP_NONE:
@ -462,25 +462,25 @@ meta_core_get_menu_accelerator (MetaMenuOp menu_op,
break; break;
case 3: case 3:
name = "move-to-workspace-3"; name = "move-to-workspace-3";
break; break;
case 4: case 4:
name = "move-to-workspace-4"; name = "move-to-workspace-4";
break; break;
case 5: case 5:
name = "move-to-workspace-5"; name = "move-to-workspace-5";
break; break;
case 6: case 6:
name = "move-to-workspace-6"; name = "move-to-workspace-6";
break; break;
case 7: case 7:
name = "move-to-workspace-7"; name = "move-to-workspace-7";
break; break;
case 8: case 8:
name = "move-to-workspace-8"; name = "move-to-workspace-8";
break; break;
case 9: case 9:
name = "move-to-workspace-9"; name = "move-to-workspace-9";
break; break;
case 10: case 10:
name = "move-to-workspace-10"; name = "move-to-workspace-10";
break; break;
@ -554,12 +554,12 @@ meta_core_begin_grab_op (Display *xdisplay,
MetaWindow *window = get_window (xdisplay, frame_xwindow); MetaWindow *window = get_window (xdisplay, frame_xwindow);
MetaDisplay *display; MetaDisplay *display;
MetaScreen *screen; MetaScreen *screen;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
screen = display->screen; screen = display->screen;
g_assert (screen != NULL); g_assert (screen != NULL);
return meta_display_begin_grab_op (display, screen, window, return meta_display_begin_grab_op (display, screen, window,
op, pointer_already_grabbed, op, pointer_already_grabbed,
frame_action, frame_action,
@ -572,7 +572,7 @@ meta_core_end_grab_op (Display *xdisplay,
guint32 timestamp) guint32 timestamp)
{ {
MetaDisplay *display; MetaDisplay *display;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
meta_display_end_grab_op (display, timestamp); meta_display_end_grab_op (display, timestamp);
@ -582,7 +582,7 @@ MetaGrabOp
meta_core_get_grab_op (Display *xdisplay) meta_core_get_grab_op (Display *xdisplay)
{ {
MetaDisplay *display; MetaDisplay *display;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
return display->grab_op; return display->grab_op;
@ -593,7 +593,7 @@ meta_core_grab_buttons (Display *xdisplay,
Window frame_xwindow) Window frame_xwindow)
{ {
MetaDisplay *display; MetaDisplay *display;
display = meta_display_for_x_display (xdisplay); display = meta_display_for_x_display (xdisplay);
meta_verbose ("Grabbing buttons on frame 0x%lx\n", frame_xwindow); meta_verbose ("Grabbing buttons on frame 0x%lx\n", frame_xwindow);

View File

@ -2,10 +2,10 @@
/* Mutter interface used by GTK+ UI to talk to core */ /* Mutter interface used by GTK+ UI to talk to core */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,10 +2,10 @@
/* Mutter window deletion */ /* Mutter window deletion */
/* /*
* Copyright (C) 2001, 2002 Havoc Pennington * Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2004 Elijah Newren * Copyright (C) 2004 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -72,7 +72,7 @@ delete_ping_timeout_func (MetaWindow *window,
char *window_title; char *window_title;
gchar *window_content, *tmp; gchar *window_content, *tmp;
GPid dialog_pid; GPid dialog_pid;
meta_topic (META_DEBUG_PING, meta_topic (META_DEBUG_PING,
"Got delete ping timeout for %s\n", "Got delete ping timeout for %s\n",
window->desc); window->desc);
@ -149,7 +149,7 @@ meta_window_delete (MetaWindow *window,
if (window->has_focus) if (window->has_focus)
{ {
/* FIXME Clean this up someday /* FIXME Clean this up someday
* http://bugzilla.gnome.org/show_bug.cgi?id=108706 * http://bugzilla.gnome.org/show_bug.cgi?id=108706
*/ */
#if 0 #if 0
@ -198,7 +198,7 @@ meta_window_present_delete_dialog (MetaWindow *window, guint32 timestamp)
meta_topic (META_DEBUG_PING, meta_topic (META_DEBUG_PING,
"Presenting existing ping dialog for %s\n", "Presenting existing ping dialog for %s\n",
window->desc); window->desc);
if (window->dialog_pid >= 0) if (window->dialog_pid >= 0)
{ {
GSList *windows; GSList *windows;
@ -207,7 +207,7 @@ meta_window_present_delete_dialog (MetaWindow *window, guint32 timestamp)
/* Activate transient for window that belongs to /* Activate transient for window that belongs to
* mutter-dialog * mutter-dialog
*/ */
windows = meta_display_list_windows (window->display, META_LIST_DEFAULT); windows = meta_display_list_windows (window->display, META_LIST_DEFAULT);
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
@ -220,7 +220,7 @@ meta_window_present_delete_dialog (MetaWindow *window, guint32 timestamp)
meta_window_activate (w, timestamp); meta_window_activate (w, timestamp);
break; break;
} }
tmp = tmp->next; tmp = tmp->next;
} }

View File

@ -2,12 +2,12 @@
/* Mutter X display handler */ /* Mutter X display handler */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -17,7 +17,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -85,7 +85,7 @@ typedef enum {
struct _MetaDisplay struct _MetaDisplay
{ {
GObject parent_instance; GObject parent_instance;
char *name; char *name;
Display *xdisplay; Display *xdisplay;
@ -143,7 +143,7 @@ struct _MetaDisplay
* multiple events with the same serial. * multiple events with the same serial.
*/ */
guint focused_by_us : 1; guint focused_by_us : 1;
/*< private-ish >*/ /*< private-ish >*/
MetaScreen *screen; MetaScreen *screen;
GHashTable *xids; GHashTable *xids;
@ -157,7 +157,7 @@ struct _MetaDisplay
*/ */
unsigned long ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS]; unsigned long ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS];
Window ungrab_should_not_cause_focus_window; Window ungrab_should_not_cause_focus_window;
guint32 current_time; guint32 current_time;
/* We maintain a sequence counter, incremented for each #MetaWindow /* We maintain a sequence counter, incremented for each #MetaWindow
@ -181,7 +181,7 @@ struct _MetaDisplay
/* Alt+click button grabs */ /* Alt+click button grabs */
ClutterModifierType window_grab_modifiers; ClutterModifierType window_grab_modifiers;
/* current window operation */ /* current window operation */
MetaGrabOp grab_op; MetaGrabOp grab_op;
MetaWindow *grab_window; MetaWindow *grab_window;
@ -234,7 +234,7 @@ struct _MetaDisplay
gboolean overlay_key_only_pressed; gboolean overlay_key_only_pressed;
MetaKeyCombo *iso_next_group_combos; MetaKeyCombo *iso_next_group_combos;
int n_iso_next_group_combos; int n_iso_next_group_combos;
/* Monitor cache */ /* Monitor cache */
unsigned int monitor_cache_invalidated : 1; unsigned int monitor_cache_invalidated : 1;

View File

@ -1,11 +1,11 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002, 2003, 2004 Red Hat, Inc. * Copyright (C) 2002, 2003, 2004 Red Hat, Inc.
* Copyright (C) 2003, 2004 Rob Adams * Copyright (C) 2003, 2004 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -441,11 +441,11 @@ meta_display_open (void)
#undef item #undef item
}; };
Atom atoms[G_N_ELEMENTS(atom_names)]; Atom atoms[G_N_ELEMENTS(atom_names)];
meta_verbose ("Opening display '%s'\n", XDisplayName (NULL)); meta_verbose ("Opening display '%s'\n", XDisplayName (NULL));
xdisplay = meta_ui_get_display (); xdisplay = meta_ui_get_display ();
if (xdisplay == NULL) if (xdisplay == NULL)
{ {
meta_warning (_("Failed to open X Window System display '%s'\n"), meta_warning (_("Failed to open X Window System display '%s'\n"),
@ -458,12 +458,12 @@ meta_display_open (void)
if (meta_is_syncing ()) if (meta_is_syncing ())
XSynchronize (xdisplay, True); XSynchronize (xdisplay, True);
g_assert (the_display == NULL); g_assert (the_display == NULL);
the_display = g_object_new (META_TYPE_DISPLAY, NULL); the_display = g_object_new (META_TYPE_DISPLAY, NULL);
the_display->closing = 0; the_display->closing = 0;
/* here we use XDisplayName which is what the user /* here we use XDisplayName which is what the user
* probably put in, vs. DisplayString(display) which is * probably put in, vs. DisplayString(display) which is
* canonicalized by XOpenDisplay() * canonicalized by XOpenDisplay()
@ -484,7 +484,7 @@ meta_display_open (void)
the_display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */ the_display->mouse_mode = TRUE; /* Only relevant for mouse or sloppy focus */
the_display->allow_terminal_deactivation = TRUE; /* Only relevant for when a the_display->allow_terminal_deactivation = TRUE; /* Only relevant for when a
terminal has the focus */ terminal has the focus */
meta_bell_init (the_display); meta_bell_init (the_display);
meta_display_init_keys (the_display); meta_display_init_keys (the_display);
@ -497,7 +497,7 @@ meta_display_open (void)
XInternAtoms (the_display->xdisplay, atom_names, G_N_ELEMENTS (atom_names), XInternAtoms (the_display->xdisplay, atom_names, G_N_ELEMENTS (atom_names),
False, atoms); False, atoms);
{ {
int i = 0; int i = 0;
#define item(x) the_display->atom_##x = atoms[i++]; #define item(x) the_display->atom_##x = atoms[i++];
#include <meta/atomnames.h> #include <meta/atomnames.h>
#undef item #undef item
@ -507,7 +507,7 @@ meta_display_open (void)
meta_display_init_window_prop_hooks (the_display); meta_display_init_window_prop_hooks (the_display);
the_display->group_prop_hooks = NULL; the_display->group_prop_hooks = NULL;
meta_display_init_group_prop_hooks (the_display); meta_display_init_group_prop_hooks (the_display);
/* Offscreen unmapped window used for _NET_SUPPORTING_WM_CHECK, /* Offscreen unmapped window used for _NET_SUPPORTING_WM_CHECK,
* created in screen_new * created in screen_new
*/ */
@ -520,9 +520,9 @@ meta_display_open (void)
the_display->window_with_menu = NULL; the_display->window_with_menu = NULL;
the_display->window_menu = NULL; the_display->window_menu = NULL;
the_display->screen = NULL; the_display->screen = NULL;
#ifdef HAVE_STARTUP_NOTIFICATION #ifdef HAVE_STARTUP_NOTIFICATION
the_display->sn_display = sn_display_new (the_display->xdisplay, the_display->sn_display = sn_display_new (the_display->xdisplay,
sn_error_trap_push, sn_error_trap_push,
@ -543,14 +543,14 @@ meta_display_open (void)
++i; ++i;
} }
the_display->ungrab_should_not_cause_focus_window = None; the_display->ungrab_should_not_cause_focus_window = None;
the_display->current_time = CurrentTime; the_display->current_time = CurrentTime;
the_display->sentinel_counter = 0; the_display->sentinel_counter = 0;
the_display->grab_resize_timeout_id = 0; the_display->grab_resize_timeout_id = 0;
the_display->grab_have_keyboard = FALSE; the_display->grab_have_keyboard = FALSE;
#ifdef HAVE_XKB #ifdef HAVE_XKB
the_display->last_bell_time = 0; the_display->last_bell_time = 0;
#endif #endif
@ -565,14 +565,14 @@ meta_display_open (void)
int major, minor; int major, minor;
the_display->have_xsync = FALSE; the_display->have_xsync = FALSE;
the_display->xsync_error_base = 0; the_display->xsync_error_base = 0;
the_display->xsync_event_base = 0; the_display->xsync_event_base = 0;
/* I don't think we really have to fill these in */ /* I don't think we really have to fill these in */
major = SYNC_MAJOR_VERSION; major = SYNC_MAJOR_VERSION;
minor = SYNC_MINOR_VERSION; minor = SYNC_MINOR_VERSION;
if (!XSyncQueryExtension (the_display->xdisplay, if (!XSyncQueryExtension (the_display->xdisplay,
&the_display->xsync_event_base, &the_display->xsync_event_base,
&the_display->xsync_error_base) || &the_display->xsync_error_base) ||
@ -596,10 +596,10 @@ meta_display_open (void)
{ {
the_display->have_shape = FALSE; the_display->have_shape = FALSE;
the_display->shape_error_base = 0; the_display->shape_error_base = 0;
the_display->shape_event_base = 0; the_display->shape_event_base = 0;
if (!XShapeQueryExtension (the_display->xdisplay, if (!XShapeQueryExtension (the_display->xdisplay,
&the_display->shape_event_base, &the_display->shape_event_base,
&the_display->shape_error_base)) &the_display->shape_error_base))
@ -609,7 +609,7 @@ meta_display_open (void)
} }
else else
the_display->have_shape = TRUE; the_display->have_shape = TRUE;
meta_verbose ("Attempted to init Shape, found error base %d event base %d\n", meta_verbose ("Attempted to init Shape, found error base %d event base %d\n",
the_display->shape_error_base, the_display->shape_error_base,
the_display->shape_event_base); the_display->shape_event_base);
@ -627,7 +627,7 @@ meta_display_open (void)
{ {
the_display->composite_error_base = 0; the_display->composite_error_base = 0;
the_display->composite_event_base = 0; the_display->composite_event_base = 0;
} }
else else
{ {
the_display->composite_major_version = 0; the_display->composite_major_version = 0;
@ -647,7 +647,7 @@ meta_display_open (void)
meta_verbose ("Attempted to init Composite, found error base %d event base %d " meta_verbose ("Attempted to init Composite, found error base %d event base %d "
"extn ver %d %d\n", "extn ver %d %d\n",
the_display->composite_error_base, the_display->composite_error_base,
the_display->composite_event_base, the_display->composite_event_base,
the_display->composite_major_version, the_display->composite_major_version,
the_display->composite_minor_version); the_display->composite_minor_version);
@ -663,12 +663,12 @@ meta_display_open (void)
{ {
the_display->damage_error_base = 0; the_display->damage_error_base = 0;
the_display->damage_event_base = 0; the_display->damage_event_base = 0;
} }
else else
the_display->have_damage = TRUE; the_display->have_damage = TRUE;
meta_verbose ("Attempted to init Damage, found error base %d event base %d\n", meta_verbose ("Attempted to init Damage, found error base %d event base %d\n",
the_display->damage_error_base, the_display->damage_error_base,
the_display->damage_event_base); the_display->damage_event_base);
the_display->xfixes_error_base = 0; the_display->xfixes_error_base = 0;
@ -691,7 +691,7 @@ meta_display_open (void)
} }
meta_verbose ("Attempted to init XFixes, found error base %d event base %d\n", meta_verbose ("Attempted to init XFixes, found error base %d event base %d\n",
the_display->xfixes_error_base, the_display->xfixes_error_base,
the_display->xfixes_event_base); the_display->xfixes_event_base);
} }
@ -751,7 +751,7 @@ meta_display_open (void)
the_display->leader_window, the_display->leader_window,
the_display->atom__GNOME_WM_KEYBINDINGS, the_display->atom__GNOME_WM_KEYBINDINGS,
gnome_wm_keybindings); gnome_wm_keybindings);
meta_prop_set_utf8_string_hint (the_display, meta_prop_set_utf8_string_hint (the_display,
the_display->leader_window, the_display->leader_window,
the_display->atom__MUTTER_VERSION, the_display->atom__MUTTER_VERSION,
@ -937,7 +937,7 @@ meta_display_list_windows (MetaDisplay *display,
GSList *next; GSList *next;
next = tmp->next; next = tmp->next;
if (next && if (next &&
next->data == tmp->data) next->data == tmp->data)
{ {
@ -948,7 +948,7 @@ meta_display_list_windows (MetaDisplay *display,
if (tmp == winlist) if (tmp == winlist)
winlist = next; winlist = next;
g_slist_free_1 (tmp); g_slist_free_1 (tmp);
/* leave prev unchanged */ /* leave prev unchanged */
@ -957,7 +957,7 @@ meta_display_list_windows (MetaDisplay *display,
{ {
prev = tmp; prev = tmp;
} }
tmp = next; tmp = next;
} }
@ -979,7 +979,7 @@ meta_display_close (MetaDisplay *display,
display->closing += 1; display->closing += 1;
meta_prefs_remove_listener (prefs_changed_callback, display); meta_prefs_remove_listener (prefs_changed_callback, display);
meta_display_remove_autoraise_callback (display); meta_display_remove_autoraise_callback (display);
if (display->focus_timeout_id) if (display->focus_timeout_id)
@ -988,7 +988,7 @@ meta_display_close (MetaDisplay *display,
/* Stop caring about events */ /* Stop caring about events */
meta_display_free_events (display); meta_display_free_events (display);
meta_screen_free (display->screen, timestamp); meta_screen_free (display->screen, timestamp);
#ifdef HAVE_STARTUP_NOTIFICATION #ifdef HAVE_STARTUP_NOTIFICATION
@ -998,7 +998,7 @@ meta_display_close (MetaDisplay *display,
display->sn_display = NULL; display->sn_display = NULL;
} }
#endif #endif
/* Must be after all calls to meta_window_unmanage() since they /* Must be after all calls to meta_window_unmanage() since they
* unregister windows * unregister windows
*/ */
@ -1011,14 +1011,14 @@ meta_display_close (MetaDisplay *display,
meta_display_free_window_prop_hooks (display); meta_display_free_window_prop_hooks (display);
meta_display_free_group_prop_hooks (display); meta_display_free_group_prop_hooks (display);
g_free (display->name); g_free (display->name);
meta_display_shutdown_keys (display); meta_display_shutdown_keys (display);
if (display->compositor) if (display->compositor)
meta_compositor_destroy (display->compositor); meta_compositor_destroy (display->compositor);
g_object_unref (display); g_object_unref (display);
the_display = NULL; the_display = NULL;
@ -1054,7 +1054,7 @@ meta_display_ungrab (MetaDisplay *display)
{ {
if (display->server_grab_count == 0) if (display->server_grab_count == 0)
meta_bug ("Ungrabbed non-grabbed server\n"); meta_bug ("Ungrabbed non-grabbed server\n");
display->server_grab_count -= 1; display->server_grab_count -= 1;
if (display->server_grab_count == 0) if (display->server_grab_count == 0)
{ {
@ -1090,7 +1090,7 @@ meta_display_for_x_display (Display *xdisplay)
meta_warning ("Could not find display for X display %p, probably going to crash\n", meta_warning ("Could not find display for X display %p, probably going to crash\n",
xdisplay); xdisplay);
return NULL; return NULL;
} }
@ -1115,8 +1115,8 @@ meta_grab_op_is_mouse (MetaGrabOp op)
{ {
case META_GRAB_OP_MOVING: case META_GRAB_OP_MOVING:
case META_GRAB_OP_RESIZING_SE: case META_GRAB_OP_RESIZING_SE:
case META_GRAB_OP_RESIZING_S: case META_GRAB_OP_RESIZING_S:
case META_GRAB_OP_RESIZING_SW: case META_GRAB_OP_RESIZING_SW:
case META_GRAB_OP_RESIZING_N: case META_GRAB_OP_RESIZING_N:
case META_GRAB_OP_RESIZING_NE: case META_GRAB_OP_RESIZING_NE:
case META_GRAB_OP_RESIZING_NW: case META_GRAB_OP_RESIZING_NW:
@ -1157,8 +1157,8 @@ meta_grab_op_is_resizing (MetaGrabOp op)
switch (op) switch (op)
{ {
case META_GRAB_OP_RESIZING_SE: case META_GRAB_OP_RESIZING_SE:
case META_GRAB_OP_RESIZING_S: case META_GRAB_OP_RESIZING_S:
case META_GRAB_OP_RESIZING_SW: case META_GRAB_OP_RESIZING_SW:
case META_GRAB_OP_RESIZING_N: case META_GRAB_OP_RESIZING_N:
case META_GRAB_OP_RESIZING_NE: case META_GRAB_OP_RESIZING_NE:
case META_GRAB_OP_RESIZING_NW: case META_GRAB_OP_RESIZING_NW:
@ -1188,7 +1188,7 @@ meta_grab_op_is_moving (MetaGrabOp op)
case META_GRAB_OP_MOVING: case META_GRAB_OP_MOVING:
case META_GRAB_OP_KEYBOARD_MOVING: case META_GRAB_OP_KEYBOARD_MOVING:
return TRUE; return TRUE;
default: default:
return FALSE; return FALSE;
} }
@ -1282,7 +1282,7 @@ guint32
meta_display_get_current_time_roundtrip (MetaDisplay *display) meta_display_get_current_time_roundtrip (MetaDisplay *display)
{ {
guint32 timestamp; guint32 timestamp;
timestamp = meta_display_get_current_time (display); timestamp = meta_display_get_current_time (display);
if (timestamp == CurrentTime) if (timestamp == CurrentTime)
{ {
@ -1323,7 +1323,7 @@ meta_display_add_ignored_crossing_serial (MetaDisplay *display,
/* don't add the same serial more than once */ /* don't add the same serial more than once */
if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS-1] == serial) if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS-1] == serial)
return; return;
/* shift serials to the left */ /* shift serials to the left */
i = 0; i = 0;
while (i < (N_IGNORED_CROSSING_SERIALS - 1)) while (i < (N_IGNORED_CROSSING_SERIALS - 1))
@ -1335,7 +1335,7 @@ meta_display_add_ignored_crossing_serial (MetaDisplay *display,
display->ignored_crossing_serials[i] = serial; display->ignored_crossing_serials[i] = serial;
} }
static gboolean static gboolean
window_raise_with_delay_callback (void *data) window_raise_with_delay_callback (void *data)
{ {
MetaWindow *window = data; MetaWindow *window = data;
@ -1345,8 +1345,8 @@ window_raise_with_delay_callback (void *data)
/* If we aren't already on top, check whether the pointer is inside /* If we aren't already on top, check whether the pointer is inside
* the window and raise the window if so. * the window and raise the window if so.
*/ */
if (meta_stack_get_top (window->screen->stack) != window) if (meta_stack_get_top (window->screen->stack) != window)
{ {
int x, y, root_x, root_y; int x, y, root_x, root_y;
Window root, child; Window root, child;
@ -1367,8 +1367,8 @@ window_raise_with_delay_callback (void *data)
if (same_screen && point_in_window) if (same_screen && point_in_window)
meta_window_raise (window); meta_window_raise (window);
else else
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Pointer not inside window, not raising %s\n", "Pointer not inside window, not raising %s\n",
window->desc); window->desc);
} }
@ -1379,15 +1379,15 @@ void
meta_display_queue_autoraise_callback (MetaDisplay *display, meta_display_queue_autoraise_callback (MetaDisplay *display,
MetaWindow *window) MetaWindow *window)
{ {
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Queuing an autoraise timeout for %s with delay %d\n", "Queuing an autoraise timeout for %s with delay %d\n",
window->desc, window->desc,
meta_prefs_get_auto_raise_delay ()); meta_prefs_get_auto_raise_delay ());
if (display->autoraise_timeout_id != 0) if (display->autoraise_timeout_id != 0)
g_source_remove (display->autoraise_timeout_id); g_source_remove (display->autoraise_timeout_id);
display->autoraise_timeout_id = display->autoraise_timeout_id =
g_timeout_add_full (G_PRIORITY_DEFAULT, g_timeout_add_full (G_PRIORITY_DEFAULT,
meta_prefs_get_auto_raise_delay (), meta_prefs_get_auto_raise_delay (),
window_raise_with_delay_callback, window_raise_with_delay_callback,
@ -1561,7 +1561,7 @@ meta_display_register_x_window (MetaDisplay *display,
MetaWindow *window) MetaWindow *window)
{ {
g_return_if_fail (g_hash_table_lookup (display->xids, xwindowp) == NULL); g_return_if_fail (g_hash_table_lookup (display->xids, xwindowp) == NULL);
g_hash_table_insert (display->xids, xwindowp, window); g_hash_table_insert (display->xids, xwindowp, window);
} }
@ -1991,7 +1991,7 @@ meta_change_button_grab (MetaDisplay *display,
mods = (XIGrabModifiers) { modmask | ignored_mask, 0 }; mods = (XIGrabModifiers) { modmask | ignored_mask, 0 };
/* GrabModeSync means freeze until XAllowEvents */ /* GrabModeSync means freeze until XAllowEvents */
if (grab) if (grab)
XIGrabButton (xdisplay, XIGrabButton (xdisplay,
META_VIRTUAL_CORE_POINTER_ID, META_VIRTUAL_CORE_POINTER_ID,
@ -2011,7 +2011,7 @@ meta_change_button_grab (MetaDisplay *display,
void void
meta_display_grab_window_buttons (MetaDisplay *display, meta_display_grab_window_buttons (MetaDisplay *display,
Window xwindow) Window xwindow)
{ {
MetaBackend *backend = meta_get_backend (); MetaBackend *backend = meta_get_backend ();
/* Do nothing under non-X11 backends */ /* Do nothing under non-X11 backends */
@ -2024,7 +2024,7 @@ meta_display_grab_window_buttons (MetaDisplay *display,
* Grab Alt + Shift + button1 for snap-moving window. * Grab Alt + Shift + button1 for snap-moving window.
*/ */
meta_verbose ("Grabbing window buttons for 0x%lx\n", xwindow); meta_verbose ("Grabbing window buttons for 0x%lx\n", xwindow);
/* FIXME If we ignored errors here instead of spewing, we could /* FIXME If we ignored errors here instead of spewing, we could
* put one big error trap around the loop and avoid a bunch of * put one big error trap around the loop and avoid a bunch of
* XSync() * XSync()
@ -2039,8 +2039,8 @@ meta_display_grab_window_buttons (MetaDisplay *display,
meta_change_button_grab (display, xwindow, meta_change_button_grab (display, xwindow,
TRUE, TRUE,
FALSE, FALSE,
i, display->window_grab_modifiers); i, display->window_grab_modifiers);
/* This is for debugging, since I end up moving the Xnest /* This is for debugging, since I end up moving the Xnest
* otherwise ;-) * otherwise ;-)
*/ */
@ -2079,7 +2079,7 @@ meta_display_ungrab_window_buttons (MetaDisplay *display,
if (display->window_grab_modifiers == 0) if (display->window_grab_modifiers == 0)
return; return;
debug = g_getenv ("MUTTER_DEBUG_BUTTON_GRABS") != NULL; debug = g_getenv ("MUTTER_DEBUG_BUTTON_GRABS") != NULL;
i = 1; i = 1;
while (i < 4) while (i < 4)
@ -2087,11 +2087,11 @@ meta_display_ungrab_window_buttons (MetaDisplay *display,
meta_change_button_grab (display, xwindow, meta_change_button_grab (display, xwindow,
FALSE, FALSE, i, FALSE, FALSE, i,
display->window_grab_modifiers); display->window_grab_modifiers);
if (debug) if (debug)
meta_change_button_grab (display, xwindow, meta_change_button_grab (display, xwindow,
FALSE, FALSE, i, ControlMask); FALSE, FALSE, i, ControlMask);
++i; ++i;
} }
} }
@ -2125,18 +2125,18 @@ meta_display_grab_focus_window_button (MetaDisplay *display,
return; return;
} }
#endif #endif
if (window->have_focus_click_grab) if (window->have_focus_click_grab)
{ {
meta_verbose (" (well, not grabbing since we already have the grab)\n"); meta_verbose (" (well, not grabbing since we already have the grab)\n");
return; return;
} }
/* FIXME If we ignored errors here instead of spewing, we could /* FIXME If we ignored errors here instead of spewing, we could
* put one big error trap around the loop and avoid a bunch of * put one big error trap around the loop and avoid a bunch of
* XSync() * XSync()
*/ */
{ {
int i = 1; int i = 1;
while (i < MAX_FOCUS_BUTTON) while (i < MAX_FOCUS_BUTTON)
@ -2145,7 +2145,7 @@ meta_display_grab_focus_window_button (MetaDisplay *display,
window->xwindow, window->xwindow,
TRUE, TRUE, TRUE, TRUE,
i, 0); i, 0);
++i; ++i;
} }
@ -2167,14 +2167,14 @@ meta_display_ungrab_focus_window_button (MetaDisplay *display,
if (!window->have_focus_click_grab) if (!window->have_focus_click_grab)
return; return;
{ {
int i = 1; int i = 1;
while (i < MAX_FOCUS_BUTTON) while (i < MAX_FOCUS_BUTTON)
{ {
meta_change_button_grab (display, window->xwindow, meta_change_button_grab (display, window->xwindow,
FALSE, FALSE, i, 0); FALSE, FALSE, i, 0);
++i; ++i;
} }
@ -2219,14 +2219,14 @@ meta_display_queue_retheme_all_windows (MetaDisplay *display)
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *window = tmp->data; MetaWindow *window = tmp->data;
meta_window_queue (window, META_QUEUE_MOVE_RESIZE); meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
meta_window_frame_size_changed (window); meta_window_frame_size_changed (window);
if (window->frame) if (window->frame)
{ {
meta_frame_queue_draw (window->frame); meta_frame_queue_draw (window->frame);
} }
tmp = tmp->next; tmp = tmp->next;
} }
@ -2512,7 +2512,7 @@ find_tab_forward (MetaDisplay *display,
return window; return window;
tmp = tmp->next; tmp = tmp->next;
} }
return NULL; return NULL;
} }
@ -2530,7 +2530,7 @@ find_tab_backward (MetaDisplay *display,
g_return_val_if_fail (workspace != NULL, NULL); g_return_val_if_fail (workspace != NULL, NULL);
tmp = start; tmp = start;
if (skip_last) if (skip_last)
tmp = tmp->prev; tmp = tmp->prev;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -2638,7 +2638,7 @@ meta_display_get_tab_list (MetaDisplay *display,
g_list_free (global_mru_list); g_list_free (global_mru_list);
g_slist_free (windows); g_slist_free (windows);
return tab_list; return tab_list;
} }
@ -2647,8 +2647,8 @@ meta_display_get_tab_list (MetaDisplay *display,
* @display: a #MetaDisplay * @display: a #MetaDisplay
* @type: type of tab list * @type: type of tab list
* @workspace: origin workspace * @workspace: origin workspace
* @window: (allow-none): starting window * @window: (allow-none): starting window
* @backward: If %TRUE, look for the previous window. * @backward: If %TRUE, look for the previous window.
* *
* Determine the next window that should be displayed for Alt-TAB * Determine the next window that should be displayed for Alt-TAB
* functionality. * functionality.
@ -2670,11 +2670,11 @@ meta_display_get_tab_next (MetaDisplay *display,
if (tab_list == NULL) if (tab_list == NULL)
return NULL; return NULL;
if (window != NULL) if (window != NULL)
{ {
g_assert (window->display == display); g_assert (window->display == display);
if (backward) if (backward)
ret = find_tab_backward (display, type, workspace, g_list_find (tab_list, window), TRUE); ret = find_tab_backward (display, type, workspace, g_list_find (tab_list, window), TRUE);
else else
@ -2682,7 +2682,7 @@ meta_display_get_tab_next (MetaDisplay *display,
} }
else else
{ {
skip = display->focus_window != NULL && skip = display->focus_window != NULL &&
tab_list->data == display->focus_window; tab_list->data == display->focus_window;
if (backward) if (backward)
ret = find_tab_backward (display, type, workspace, tab_list, skip); ret = find_tab_backward (display, type, workspace, tab_list, skip);
@ -2713,7 +2713,7 @@ meta_display_get_tab_current (MetaDisplay *display,
MetaWindow *window; MetaWindow *window;
window = display->focus_window; window = display->focus_window;
if (window != NULL && if (window != NULL &&
IN_TAB_CHAIN (window, type) && IN_TAB_CHAIN (window, type) &&
(workspace == NULL || (workspace == NULL ||
@ -2727,7 +2727,7 @@ int
meta_resize_gravity_from_grab_op (MetaGrabOp op) meta_resize_gravity_from_grab_op (MetaGrabOp op)
{ {
int gravity; int gravity;
gravity = -1; gravity = -1;
switch (op) switch (op)
{ {
@ -2809,7 +2809,7 @@ meta_display_unmanage_windows_for_screen (MetaDisplay *display,
if (!window->unmanaging) if (!window->unmanaging)
meta_window_unmanage (window, timestamp); meta_window_unmanage (window, timestamp);
g_object_unref (window); g_object_unref (window);
tmp = tmp->next; tmp = tmp->next;
} }
g_slist_free (winlist); g_slist_free (winlist);
@ -2859,7 +2859,7 @@ meta_display_devirtualize_modifiers (MetaDisplay *display,
unsigned int *mask) unsigned int *mask)
{ {
*mask = 0; *mask = 0;
if (modifiers & META_VIRTUAL_SHIFT_MASK) if (modifiers & META_VIRTUAL_SHIFT_MASK)
*mask |= ShiftMask; *mask |= ShiftMask;
if (modifiers & META_VIRTUAL_CONTROL_MASK) if (modifiers & META_VIRTUAL_CONTROL_MASK)
@ -2879,7 +2879,7 @@ meta_display_devirtualize_modifiers (MetaDisplay *display,
if (modifiers & META_VIRTUAL_MOD4_MASK) if (modifiers & META_VIRTUAL_MOD4_MASK)
*mask |= Mod4Mask; *mask |= Mod4Mask;
if (modifiers & META_VIRTUAL_MOD5_MASK) if (modifiers & META_VIRTUAL_MOD5_MASK)
*mask |= Mod5Mask; *mask |= Mod5Mask;
} }
static void static void
@ -2887,11 +2887,11 @@ update_window_grab_modifiers (MetaDisplay *display)
{ {
MetaVirtualModifier virtual_mods; MetaVirtualModifier virtual_mods;
unsigned int mods; unsigned int mods;
virtual_mods = meta_prefs_get_mouse_button_mods (); virtual_mods = meta_prefs_get_mouse_button_mods ();
meta_display_devirtualize_modifiers (display, virtual_mods, meta_display_devirtualize_modifiers (display, virtual_mods,
&mods); &mods);
display->window_grab_modifiers = mods; display->window_grab_modifiers = mods;
} }
@ -2900,7 +2900,7 @@ prefs_changed_callback (MetaPreference pref,
void *data) void *data)
{ {
MetaDisplay *display = data; MetaDisplay *display = data;
/* It may not be obvious why we regrab on focus mode /* It may not be obvious why we regrab on focus mode
* change; it's because we handle focus clicks a * change; it's because we handle focus clicks a
* bit differently for the different focus modes. * bit differently for the different focus modes.
@ -2911,9 +2911,9 @@ prefs_changed_callback (MetaPreference pref,
MetaDisplay *display = data; MetaDisplay *display = data;
GSList *windows; GSList *windows;
GSList *tmp; GSList *tmp;
windows = meta_display_list_windows (display, META_LIST_DEFAULT); windows = meta_display_list_windows (display, META_LIST_DEFAULT);
/* Ungrab all */ /* Ungrab all */
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
@ -2960,13 +2960,13 @@ meta_display_increment_focus_sentinel (MetaDisplay *display)
unsigned long data[1]; unsigned long data[1];
data[0] = meta_display_get_current_time (display); data[0] = meta_display_get_current_time (display);
XChangeProperty (display->xdisplay, XChangeProperty (display->xdisplay,
display->screen->xroot, display->screen->xroot,
display->atom__MUTTER_SENTINEL, display->atom__MUTTER_SENTINEL,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) data, 1); 32, PropModeReplace, (guchar*) data, 1);
display->sentinel_counter += 1; display->sentinel_counter += 1;
} }
@ -3015,7 +3015,7 @@ meta_display_sanity_check_timestamps (MetaDisplay *display,
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *window = tmp->data; MetaWindow *window = tmp->data;
if (XSERVER_TIME_IS_BEFORE (timestamp, window->net_wm_user_time)) if (XSERVER_TIME_IS_BEFORE (timestamp, window->net_wm_user_time))
{ {
meta_warning ("%s appears to be one of the offending windows " meta_warning ("%s appears to be one of the offending windows "
@ -3032,7 +3032,7 @@ meta_display_sanity_check_timestamps (MetaDisplay *display,
} }
void void
meta_display_set_input_focus_window (MetaDisplay *display, meta_display_set_input_focus_window (MetaDisplay *display,
MetaWindow *window, MetaWindow *window,
gboolean focus_frame, gboolean focus_frame,
guint32 timestamp) guint32 timestamp)
@ -3188,7 +3188,7 @@ meta_display_get_focus_window (MetaDisplay *display)
return display->focus_window; return display->focus_window;
} }
int int
meta_display_get_damage_event_base (MetaDisplay *display) meta_display_get_damage_event_base (MetaDisplay *display)
{ {
return display->damage_event_base; return display->damage_event_base;

View File

@ -2,9 +2,9 @@
/* Edge resistance for move/resize operations */ /* Edge resistance for move/resize operations */
/* /*
* Copyright (C) 2005, 2006 Elijah Newren * Copyright (C) 2005, 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -245,8 +245,8 @@ find_nearest_position (const GArray *edges,
{ {
edge = g_array_index (edges, MetaEdge*, i); edge = g_array_index (edges, MetaEdge*, i);
compare = horizontal ? edge->rect.x : edge->rect.y; compare = horizontal ? edge->rect.x : edge->rect.y;
edges_align = horizontal ? edges_align = horizontal ?
meta_rectangle_vert_overlap (&edge->rect, new_rect) : meta_rectangle_vert_overlap (&edge->rect, new_rect) :
meta_rectangle_horiz_overlap (&edge->rect, new_rect); meta_rectangle_horiz_overlap (&edge->rect, new_rect);
@ -269,8 +269,8 @@ find_nearest_position (const GArray *edges,
{ {
edge = g_array_index (edges, MetaEdge*, i); edge = g_array_index (edges, MetaEdge*, i);
compare = horizontal ? edge->rect.x : edge->rect.y; compare = horizontal ? edge->rect.x : edge->rect.y;
edges_align = horizontal ? edges_align = horizontal ?
meta_rectangle_vert_overlap (&edge->rect, new_rect) : meta_rectangle_vert_overlap (&edge->rect, new_rect) :
meta_rectangle_horiz_overlap (&edge->rect, new_rect); meta_rectangle_horiz_overlap (&edge->rect, new_rect);
@ -433,7 +433,7 @@ apply_edge_resistance (MetaWindow *window,
if (!resistance_data->timeout_setup && if (!resistance_data->timeout_setup &&
timeout_length_ms != 0) timeout_length_ms != 0)
{ {
resistance_data->timeout_id = resistance_data->timeout_id =
g_timeout_add (timeout_length_ms, g_timeout_add (timeout_length_ms,
edge_resistance_timeout, edge_resistance_timeout,
resistance_data); resistance_data);
@ -536,7 +536,7 @@ apply_edge_snapping (int old_pos,
* display->grab_edge_resistance_data MUST already be setup or calling this * display->grab_edge_resistance_data MUST already be setup or calling this
* function will cause a crash. * function will cause a crash.
*/ */
static gboolean static gboolean
apply_edge_resistance_to_each_side (MetaDisplay *display, apply_edge_resistance_to_each_side (MetaDisplay *display,
MetaWindow *window, MetaWindow *window,
const MetaRectangle *old_outer, const MetaRectangle *old_outer,
@ -658,7 +658,7 @@ apply_edge_resistance_to_each_side (MetaDisplay *display,
} }
/* Determine whether anything changed, and save the changes */ /* Determine whether anything changed, and save the changes */
modified_rect = meta_rect (new_left, modified_rect = meta_rect (new_left,
new_top, new_top,
new_right - new_left, new_right - new_left,
new_bottom - new_top); new_bottom - new_top);
@ -754,7 +754,7 @@ meta_display_cleanup_edges (MetaDisplay *display)
} }
static int static int
stupid_sort_requiring_extra_pointer_dereference (gconstpointer a, stupid_sort_requiring_extra_pointer_dereference (gconstpointer a,
gconstpointer b) gconstpointer b)
{ {
const MetaEdge * const *a_edge = a; const MetaEdge * const *a_edge = a;
@ -779,7 +779,7 @@ cache_edges (MetaDisplay *display,
#ifdef WITH_VERBOSE_MODE #ifdef WITH_VERBOSE_MODE
if (meta_is_verbose()) if (meta_is_verbose())
{ {
int max_edges = MAX (MAX( g_list_length (window_edges), int max_edges = MAX (MAX( g_list_length (window_edges),
g_list_length (monitor_edges)), g_list_length (monitor_edges)),
g_list_length (screen_edges)); g_list_length (screen_edges));
char big_buffer[(EDGE_LENGTH+2)*max_edges]; char big_buffer[(EDGE_LENGTH+2)*max_edges];
@ -916,13 +916,13 @@ cache_edges (MetaDisplay *display,
* avoided this sort by sticking them into the array with some simple * avoided this sort by sticking them into the array with some simple
* merging of the lists). * merging of the lists).
*/ */
g_array_sort (display->grab_edge_resistance_data->left_edges, g_array_sort (display->grab_edge_resistance_data->left_edges,
stupid_sort_requiring_extra_pointer_dereference); stupid_sort_requiring_extra_pointer_dereference);
g_array_sort (display->grab_edge_resistance_data->right_edges, g_array_sort (display->grab_edge_resistance_data->right_edges,
stupid_sort_requiring_extra_pointer_dereference); stupid_sort_requiring_extra_pointer_dereference);
g_array_sort (display->grab_edge_resistance_data->top_edges, g_array_sort (display->grab_edge_resistance_data->top_edges,
stupid_sort_requiring_extra_pointer_dereference); stupid_sort_requiring_extra_pointer_dereference);
g_array_sort (display->grab_edge_resistance_data->bottom_edges, g_array_sort (display->grab_edge_resistance_data->bottom_edges,
stupid_sort_requiring_extra_pointer_dereference); stupid_sort_requiring_extra_pointer_dereference);
} }
@ -986,7 +986,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
new_rect = g_new (MetaRectangle, 1); new_rect = g_new (MetaRectangle, 1);
meta_window_get_frame_rect (cur_window, new_rect); meta_window_get_frame_rect (cur_window, new_rect);
obscuring_windows = g_slist_prepend (obscuring_windows, new_rect); obscuring_windows = g_slist_prepend (obscuring_windows, new_rect);
window_stacking = window_stacking =
g_slist_prepend (window_stacking, GINT_TO_POINTER (stack_position)); g_slist_prepend (window_stacking, GINT_TO_POINTER (stack_position));
} }
@ -1026,7 +1026,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
* is offscreen (we also don't care about parts of edges covered * is offscreen (we also don't care about parts of edges covered
* by other windows or DOCKS, but that's handled below). * by other windows or DOCKS, but that's handled below).
*/ */
meta_rectangle_intersect (&cur_rect, meta_rectangle_intersect (&cur_rect,
&display->screen->rect, &display->screen->rect,
&reduced); &reduced);
@ -1052,7 +1052,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
new_edge->side_type = META_SIDE_LEFT; new_edge->side_type = META_SIDE_LEFT;
new_edge->edge_type = META_EDGE_WINDOW; new_edge->edge_type = META_EDGE_WINDOW;
new_edges = g_list_prepend (new_edges, new_edge); new_edges = g_list_prepend (new_edges, new_edge);
/* Top side of this window is resistance for the bottom edge of /* Top side of this window is resistance for the bottom edge of
* the window being moved. * the window being moved.
*/ */
@ -1077,7 +1077,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
/* Update the remaining windows to only those at a higher /* Update the remaining windows to only those at a higher
* stacking position than this one. * stacking position than this one.
*/ */
while (rem_win_stacking && while (rem_win_stacking &&
stack_position >= GPOINTER_TO_INT (rem_win_stacking->data)) stack_position >= GPOINTER_TO_INT (rem_win_stacking->data))
{ {
rem_windows = rem_windows->next; rem_windows = rem_windows->next;
@ -1085,7 +1085,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
} }
/* Remove edge portions overlapped by rem_windows and rem_docks */ /* Remove edge portions overlapped by rem_windows and rem_docks */
new_edges = new_edges =
meta_rectangle_remove_intersections_with_boxes_from_edges ( meta_rectangle_remove_intersections_with_boxes_from_edges (
new_edges, new_edges,
rem_windows); rem_windows);
@ -1107,7 +1107,7 @@ compute_resistance_and_snapping_edges (MetaDisplay *display)
/* FIXME: Shouldn't there be a helper function to make this one line of code /* FIXME: Shouldn't there be a helper function to make this one line of code
* to free a list instead of four ugly ones? * to free a list instead of four ugly ones?
*/ */
g_slist_foreach (obscuring_windows, g_slist_foreach (obscuring_windows,
(void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */ (void (*)(gpointer,gpointer))&g_free, /* ew, for ugly */
NULL); NULL);
g_slist_free (obscuring_windows); g_slist_free (obscuring_windows);
@ -1205,7 +1205,7 @@ meta_window_edge_resistance_for_move (MetaWindow *window,
else else
smaller_y_change = bottom_change; smaller_y_change = bottom_change;
*new_x = old_x + smaller_x_change + *new_x = old_x + smaller_x_change +
(BOX_LEFT (*reference) - BOX_LEFT (old_outer)); (BOX_LEFT (*reference) - BOX_LEFT (old_outer));
*new_y = old_y + smaller_y_change + *new_y = old_y + smaller_y_change +
(BOX_TOP (*reference) - BOX_TOP (old_outer)); (BOX_TOP (*reference) - BOX_TOP (old_outer));
@ -1239,7 +1239,7 @@ meta_window_edge_resistance_for_resize (MetaWindow *window,
meta_window_get_frame_rect (window, &old_outer); meta_window_get_frame_rect (window, &old_outer);
proposed_outer_width = old_outer.width + (*new_width - old_width); proposed_outer_width = old_outer.width + (*new_width - old_width);
proposed_outer_height = old_outer.height + (*new_height - old_height); proposed_outer_height = old_outer.height + (*new_height - old_height);
meta_rectangle_resize_with_gravity (&old_outer, meta_rectangle_resize_with_gravity (&old_outer,
&new_outer, &new_outer,
gravity, gravity,
proposed_outer_width, proposed_outer_width,

View File

@ -2,9 +2,9 @@
/* Edge resistance for move/resize operations */ /* Edge resistance for move/resize operations */
/* /*
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -1,9 +1,9 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington, error trapping inspired by GDK * Copyright (C) 2001 Havoc Pennington, error trapping inspired by GDK
* code copyrighted by the GTK team. * code copyrighted by the GTK team.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -13,7 +13,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,11 +2,11 @@
/* Mutter X window decorations */ /* Mutter X window decorations */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003, 2004 Red Hat, Inc. * Copyright (C) 2003, 2004 Red Hat, Inc.
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -43,10 +43,10 @@ meta_window_ensure_frame (MetaWindow *window)
Visual *visual; Visual *visual;
gulong create_serial; gulong create_serial;
MetaStackWindow stack_window; MetaStackWindow stack_window;
if (window->frame) if (window->frame)
return; return;
frame = g_new (MetaFrame, 1); frame = g_new (MetaFrame, 1);
frame->window = window; frame->window = window;
@ -61,7 +61,7 @@ meta_window_ensure_frame (MetaWindow *window)
frame->is_flashing = FALSE; frame->is_flashing = FALSE;
frame->borders_cached = FALSE; frame->borders_cached = FALSE;
meta_verbose ("Framing window %s: visual %s default, depth %d default depth %d\n", meta_verbose ("Framing window %s: visual %s default, depth %d default depth %d\n",
window->desc, window->desc,
XVisualIDFromVisual (window->xvisual) == XVisualIDFromVisual (window->xvisual) ==
@ -71,7 +71,7 @@ meta_window_ensure_frame (MetaWindow *window)
meta_verbose ("Frame geometry %d,%d %dx%d\n", meta_verbose ("Frame geometry %d,%d %dx%d\n",
frame->rect.x, frame->rect.y, frame->rect.x, frame->rect.y,
frame->rect.width, frame->rect.height); frame->rect.width, frame->rect.height);
/* Default depth/visual handles clients with weird visuals; they can /* Default depth/visual handles clients with weird visuals; they can
* always be children of the root depth/visual obviously, but * 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 * e.g. DRI games can't be children of a parent that has the same
@ -80,7 +80,7 @@ meta_window_ensure_frame (MetaWindow *window)
* We look for an ARGB visual if we can find one, otherwise use * We look for an ARGB visual if we can find one, otherwise use
* the default of NULL. * the default of NULL.
*/ */
/* Special case for depth 32 windows (assumed to be ARGB), /* Special case for depth 32 windows (assumed to be ARGB),
* we use the window's visual. Otherwise we just use the system visual. * we use the window's visual. Otherwise we just use the system visual.
*/ */
@ -88,7 +88,7 @@ meta_window_ensure_frame (MetaWindow *window)
visual = window->xvisual; visual = window->xvisual;
else else
visual = NULL; visual = NULL;
frame->xwindow = meta_ui_create_frame_window (window->screen->ui, frame->xwindow = meta_ui_create_frame_window (window->screen->ui,
window->display->xdisplay, window->display->xdisplay,
visual, visual,
@ -108,7 +108,7 @@ meta_window_ensure_frame (MetaWindow *window)
attrs.event_mask = EVENT_MASK; attrs.event_mask = EVENT_MASK;
XChangeWindowAttributes (window->display->xdisplay, XChangeWindowAttributes (window->display->xdisplay,
frame->xwindow, CWEventMask, &attrs); frame->xwindow, CWEventMask, &attrs);
meta_display_register_x_window (window->display, &frame->xwindow, window); meta_display_register_x_window (window->display, &frame->xwindow, window);
meta_error_trap_push (window->display); meta_error_trap_push (window->display);
@ -136,7 +136,7 @@ meta_window_ensure_frame (MetaWindow *window)
window->rect.y); window->rect.y);
/* FIXME handle this error */ /* FIXME handle this error */
meta_error_trap_pop (window->display); meta_error_trap_pop (window->display);
/* stick frame to the window */ /* stick frame to the window */
window->frame = frame; window->frame = frame;
@ -145,7 +145,7 @@ meta_window_ensure_frame (MetaWindow *window)
*/ */
meta_ui_update_frame_style (window->screen->ui, frame->xwindow); meta_ui_update_frame_style (window->screen->ui, frame->xwindow);
meta_ui_reset_frame_bg (window->screen->ui, frame->xwindow); meta_ui_reset_frame_bg (window->screen->ui, frame->xwindow);
if (window->title) if (window->title)
meta_ui_set_frame_title (window->screen->ui, meta_ui_set_frame_title (window->screen->ui,
window->frame->xwindow, window->frame->xwindow,
@ -163,18 +163,18 @@ meta_window_destroy_frame (MetaWindow *window)
MetaFrame *frame; MetaFrame *frame;
MetaFrameBorders borders; MetaFrameBorders borders;
MetaStackWindow stack_window; MetaStackWindow stack_window;
if (window->frame == NULL) if (window->frame == NULL)
return; return;
meta_verbose ("Unframing window %s\n", window->desc); meta_verbose ("Unframing window %s\n", window->desc);
frame = window->frame; frame = window->frame;
meta_frame_calc_borders (frame, &borders); meta_frame_calc_borders (frame, &borders);
meta_bell_notify_frame_destroy (frame); meta_bell_notify_frame_destroy (frame);
/* Unparent the client window; it may be destroyed, /* Unparent the client window; it may be destroyed,
* thus the error trap. * thus the error trap.
*/ */
@ -209,7 +209,7 @@ meta_window_destroy_frame (MetaWindow *window)
meta_display_unregister_x_window (window->display, meta_display_unregister_x_window (window->display,
frame->xwindow); frame->xwindow);
window->frame = NULL; window->frame = NULL;
if (window->frame_bounds) if (window->frame_bounds)
{ {
@ -219,9 +219,9 @@ meta_window_destroy_frame (MetaWindow *window)
/* Move keybindings to window instead of frame */ /* Move keybindings to window instead of frame */
meta_window_grab_keys (window); meta_window_grab_keys (window);
g_free (frame); g_free (frame);
/* Put our state back where it should be */ /* Put our state back where it should be */
meta_window_queue (window, META_QUEUE_CALC_SHOWING); meta_window_queue (window, META_QUEUE_CALC_SHOWING);
meta_window_queue (window, META_QUEUE_MOVE_RESIZE); meta_window_queue (window, META_QUEUE_MOVE_RESIZE);
@ -244,20 +244,20 @@ meta_frame_get_flags (MetaFrame *frame)
else else
{ {
flags |= META_FRAME_ALLOWS_MENU; flags |= META_FRAME_ALLOWS_MENU;
if (frame->window->has_close_func) if (frame->window->has_close_func)
flags |= META_FRAME_ALLOWS_DELETE; flags |= META_FRAME_ALLOWS_DELETE;
if (frame->window->has_maximize_func) if (frame->window->has_maximize_func)
flags |= META_FRAME_ALLOWS_MAXIMIZE; flags |= META_FRAME_ALLOWS_MAXIMIZE;
if (frame->window->has_minimize_func) if (frame->window->has_minimize_func)
flags |= META_FRAME_ALLOWS_MINIMIZE; flags |= META_FRAME_ALLOWS_MINIMIZE;
if (frame->window->has_shade_func) if (frame->window->has_shade_func)
flags |= META_FRAME_ALLOWS_SHADE; flags |= META_FRAME_ALLOWS_SHADE;
} }
if (META_WINDOW_ALLOWS_MOVE (frame->window)) if (META_WINDOW_ALLOWS_MOVE (frame->window))
flags |= META_FRAME_ALLOWS_MOVE; flags |= META_FRAME_ALLOWS_MOVE;
@ -266,7 +266,7 @@ meta_frame_get_flags (MetaFrame *frame)
if (META_WINDOW_ALLOWS_VERTICAL_RESIZE (frame->window)) if (META_WINDOW_ALLOWS_VERTICAL_RESIZE (frame->window))
flags |= META_FRAME_ALLOWS_VERTICAL_RESIZE; flags |= META_FRAME_ALLOWS_VERTICAL_RESIZE;
if (meta_window_appears_focused (frame->window)) if (meta_window_appears_focused (frame->window))
flags |= META_FRAME_HAS_FOCUS; flags |= META_FRAME_HAS_FOCUS;
@ -296,7 +296,7 @@ meta_frame_get_flags (MetaFrame *frame)
if (frame->window->wm_state_above) if (frame->window->wm_state_above)
flags |= META_FRAME_ABOVE; flags |= META_FRAME_ABOVE;
return flags; return flags;
} }
@ -418,7 +418,7 @@ meta_frame_set_screen_cursor (MetaFrame *frame,
if (cursor == META_CURSOR_DEFAULT) if (cursor == META_CURSOR_DEFAULT)
XUndefineCursor (frame->window->display->xdisplay, frame->xwindow); XUndefineCursor (frame->window->display->xdisplay, frame->xwindow);
else else
{ {
xcursor = meta_display_create_x_cursor (frame->window->display, cursor); xcursor = meta_display_create_x_cursor (frame->window->display, cursor);
XDefineCursor (frame->window->display->xdisplay, frame->xwindow, xcursor); XDefineCursor (frame->window->display->xdisplay, frame->xwindow, xcursor);
XFlush (frame->window->display->xdisplay); XFlush (frame->window->display->xdisplay);

View File

@ -2,9 +2,9 @@
/* Mutter X window decorations */ /* Mutter X window decorations */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -7,9 +7,9 @@
* the one to close a window. It also deals with incoming key events. * the one to close a window. It also deals with incoming key events.
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -19,7 +19,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,10 +2,10 @@
/* Mutter main() */ /* Mutter main() */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2006 Elijah Newren * Copyright (C) 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -160,7 +160,7 @@ meta_print_self_identity (void)
g_date_strftime (buf, sizeof (buf), "%x", &d); g_date_strftime (buf, sizeof (buf), "%x", &d);
meta_verbose ("Mutter version %s running on %s\n", meta_verbose ("Mutter version %s running on %s\n",
VERSION, buf); VERSION, buf);
/* Locale and encoding. */ /* Locale and encoding. */
g_get_charset (&charset); g_get_charset (&charset);
meta_verbose ("Running in locale \"%s\" with encoding \"%s\"\n", meta_verbose ("Running in locale \"%s\" with encoding \"%s\"\n",
@ -343,7 +343,7 @@ meta_init (void)
g_get_home_dir ()); g_get_home_dir ());
meta_print_self_identity (); meta_print_self_identity ();
#ifdef HAVE_INTROSPECTION #ifdef HAVE_INTROSPECTION
g_irepository_prepend_search_path (MUTTER_PKGLIBDIR); g_irepository_prepend_search_path (MUTTER_PKGLIBDIR);
#endif #endif
@ -358,13 +358,13 @@ meta_init (void)
meta_select_display (opt_display_name); meta_select_display (opt_display_name);
meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL)); meta_set_syncing (opt_sync || (g_getenv ("MUTTER_SYNC") != NULL));
if (opt_replace_wm) if (opt_replace_wm)
meta_set_replace_current_wm (TRUE); meta_set_replace_current_wm (TRUE);
if (opt_save_file && opt_client_id) if (opt_save_file && opt_client_id)
meta_fatal ("Can't specify both SM save file and SM client id\n"); meta_fatal ("Can't specify both SM save file and SM client id\n");
meta_main_loop = g_main_loop_new (NULL, FALSE); meta_main_loop = g_main_loop_new (NULL, FALSE);
meta_ui_init (); meta_ui_init ();
@ -455,7 +455,7 @@ meta_run (void)
if (g_getenv ("MUTTER_G_FATAL_WARNINGS") != NULL) if (g_getenv ("MUTTER_G_FATAL_WARNINGS") != NULL)
g_log_set_always_fatal (G_LOG_LEVEL_MASK); g_log_set_always_fatal (G_LOG_LEVEL_MASK);
meta_ui_set_current_theme (meta_prefs_get_theme ()); meta_ui_set_current_theme (meta_prefs_get_theme ());
/* Try to find some theme that'll work if the theme preference /* Try to find some theme that'll work if the theme preference
@ -464,37 +464,37 @@ meta_run (void)
*/ */
if (!meta_ui_have_a_theme ()) if (!meta_ui_have_a_theme ())
meta_ui_set_current_theme ("Simple"); meta_ui_set_current_theme ("Simple");
if (!meta_ui_have_a_theme ()) if (!meta_ui_have_a_theme ())
{ {
const char *dir_entry = NULL; const char *dir_entry = NULL;
GError *err = NULL; GError *err = NULL;
GDir *themes_dir = NULL; GDir *themes_dir = NULL;
if (!(themes_dir = g_dir_open (MUTTER_DATADIR"/themes", 0, &err))) if (!(themes_dir = g_dir_open (MUTTER_DATADIR"/themes", 0, &err)))
{ {
meta_fatal (_("Failed to scan themes directory: %s\n"), err->message); meta_fatal (_("Failed to scan themes directory: %s\n"), err->message);
g_error_free (err); g_error_free (err);
} }
else else
{ {
while (((dir_entry = g_dir_read_name (themes_dir)) != NULL) && while (((dir_entry = g_dir_read_name (themes_dir)) != NULL) &&
(!meta_ui_have_a_theme ())) (!meta_ui_have_a_theme ()))
{ {
meta_ui_set_current_theme (dir_entry); meta_ui_set_current_theme (dir_entry);
} }
g_dir_close (themes_dir); g_dir_close (themes_dir);
} }
} }
if (!meta_ui_have_a_theme ()) if (!meta_ui_have_a_theme ())
meta_fatal (_("Could not find a theme! Be sure %s exists and contains the usual themes.\n"), meta_fatal (_("Could not find a theme! Be sure %s exists and contains the usual themes.\n"),
MUTTER_DATADIR"/themes"); MUTTER_DATADIR"/themes");
if (!meta_display_open ()) if (!meta_display_open ())
meta_exit (META_EXIT_ERROR); meta_exit (META_EXIT_ERROR);
g_main_loop_run (meta_main_loop); g_main_loop_run (meta_main_loop);
meta_finalize (); meta_finalize ();

View File

@ -12,7 +12,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,12 +2,12 @@
/* Mutter window placement */ /* Mutter window placement */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat, Inc. * Copyright (C) 2002, 2003 Red Hat, Inc.
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -17,7 +17,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -57,11 +57,11 @@ northwestcmp (gconstpointer a, gconstpointer b)
ay = a_frame.y; ay = a_frame.y;
bx = b_frame.x; bx = b_frame.x;
by = b_frame.y; by = b_frame.y;
/* probably there's a fast good-enough-guess we could use here. */ /* probably there's a fast good-enough-guess we could use here. */
from_origin_a = sqrt (ax * ax + ay * ay); from_origin_a = sqrt (ax * ax + ay * ay);
from_origin_b = sqrt (bx * bx + by * by); from_origin_b = sqrt (bx * bx + by * by);
if (from_origin_a < from_origin_b) if (from_origin_a < from_origin_b)
return -1; return -1;
else if (from_origin_a > from_origin_b) else if (from_origin_a > from_origin_b)
@ -88,16 +88,16 @@ find_next_cascade (MetaWindow *window,
int cascade_stage; int cascade_stage;
MetaRectangle work_area; MetaRectangle work_area;
int current; int current;
sorted = g_list_copy (windows); sorted = g_list_copy (windows);
sorted = g_list_sort (sorted, northwestcmp); sorted = g_list_sort (sorted, northwestcmp);
/* This is a "fuzzy" cascade algorithm. /* This is a "fuzzy" cascade algorithm.
* For each window in the list, we find where we'd cascade a * For each window in the list, we find where we'd cascade a
* new window after it. If a window is already nearly at that * new window after it. If a window is already nearly at that
* position, we move on. * position, we move on.
*/ */
/* arbitrary-ish threshold, honors user attempts to /* arbitrary-ish threshold, honors user attempts to
* manually cascade. * manually cascade.
*/ */
@ -115,7 +115,7 @@ find_next_cascade (MetaWindow *window,
x_threshold = CASCADE_FUZZ; x_threshold = CASCADE_FUZZ;
y_threshold = CASCADE_FUZZ; y_threshold = CASCADE_FUZZ;
} }
/* Find furthest-SE origin of all workspaces. /* Find furthest-SE origin of all workspaces.
* cascade_x, cascade_y are the target position * cascade_x, cascade_y are the target position
* of NW corner of window frame. * of NW corner of window frame.
@ -126,13 +126,13 @@ find_next_cascade (MetaWindow *window,
cascade_x = MAX (0, work_area.x); cascade_x = MAX (0, work_area.x);
cascade_y = MAX (0, work_area.y); cascade_y = MAX (0, work_area.y);
/* Find first cascade position that's not used. */ /* Find first cascade position that's not used. */
meta_window_get_frame_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
window_width = frame_rect.width; window_width = frame_rect.width;
window_height = frame_rect.height; window_height = frame_rect.height;
cascade_stage = 0; cascade_stage = 0;
tmp = sorted; tmp = sorted;
while (tmp != NULL) while (tmp != NULL)
@ -140,14 +140,14 @@ find_next_cascade (MetaWindow *window,
MetaWindow *w; MetaWindow *w;
MetaRectangle w_frame_rect; MetaRectangle w_frame_rect;
int wx, wy; int wx, wy;
w = tmp->data; w = tmp->data;
/* we want frame position, not window position */ /* we want frame position, not window position */
meta_window_get_frame_rect (w, &w_frame_rect); meta_window_get_frame_rect (w, &w_frame_rect);
wx = w_frame_rect.x; wx = w_frame_rect.x;
wy = w_frame_rect.y; wy = w_frame_rect.y;
if (ABS (wx - cascade_x) < x_threshold && if (ABS (wx - cascade_x) < x_threshold &&
ABS (wy - cascade_y) < y_threshold) ABS (wy - cascade_y) < y_threshold)
{ {
@ -158,7 +158,7 @@ find_next_cascade (MetaWindow *window,
meta_window_get_position (w, &wx, &wy); meta_window_get_position (w, &wx, &wy);
cascade_x = wx; cascade_x = wx;
cascade_y = wy; cascade_y = wy;
/* If we go off the screen, start over with a new cascade */ /* If we go off the screen, start over with a new cascade */
if (((cascade_x + window_width) > if (((cascade_x + window_width) >
(work_area.x + work_area.width)) || (work_area.x + work_area.width)) ||
@ -167,11 +167,11 @@ find_next_cascade (MetaWindow *window,
{ {
cascade_x = MAX (0, work_area.x); cascade_x = MAX (0, work_area.x);
cascade_y = MAX (0, work_area.y); cascade_y = MAX (0, work_area.y);
#define CASCADE_INTERVAL 50 /* space between top-left corners of cascades */ #define CASCADE_INTERVAL 50 /* space between top-left corners of cascades */
cascade_stage += 1; cascade_stage += 1;
cascade_x += CASCADE_INTERVAL * cascade_stage; cascade_x += CASCADE_INTERVAL * cascade_stage;
/* start over with a new cascade translated to the right, unless /* start over with a new cascade translated to the right, unless
* we are out of space * we are out of space
*/ */
@ -193,14 +193,14 @@ find_next_cascade (MetaWindow *window,
{ {
/* Keep searching for a further-down-the-diagonal window. */ /* Keep searching for a further-down-the-diagonal window. */
} }
tmp = tmp->next; tmp = tmp->next;
} }
/* cascade_x and cascade_y will match the last window in the list /* cascade_x and cascade_y will match the last window in the list
* that was "in the way" (in the approximate cascade diagonal) * that was "in the way" (in the approximate cascade diagonal)
*/ */
g_list_free (sorted); g_list_free (sorted);
*new_x = cascade_x; *new_x = cascade_x;
@ -376,12 +376,12 @@ rectangle_overlaps_some_window (MetaRectangle *rect,
{ {
GList *tmp; GList *tmp;
MetaRectangle dest; MetaRectangle dest;
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *other = tmp->data; MetaWindow *other = tmp->data;
MetaRectangle other_rect; MetaRectangle other_rect;
switch (other->type) switch (other->type)
{ {
@ -405,12 +405,12 @@ rectangle_overlaps_some_window (MetaRectangle *rect,
case META_WINDOW_TOOLBAR: case META_WINDOW_TOOLBAR:
case META_WINDOW_MENU: case META_WINDOW_MENU:
meta_window_get_frame_rect (other, &other_rect); meta_window_get_frame_rect (other, &other_rect);
if (meta_rectangle_intersect (rect, &other_rect, &dest)) if (meta_rectangle_intersect (rect, &other_rect, &dest))
return TRUE; return TRUE;
break; break;
} }
tmp = tmp->next; tmp = tmp->next;
} }
@ -503,20 +503,20 @@ find_first_fit (MetaWindow *window,
* the bottom of each existing window, and then to the right * the bottom of each existing window, and then to the right
* of each existing window, aligned with the left/top of the * of each existing window, aligned with the left/top of the
* existing window in each of those cases. * existing window in each of those cases.
*/ */
int retval; int retval;
GList *below_sorted; GList *below_sorted;
GList *right_sorted; GList *right_sorted;
GList *tmp; GList *tmp;
MetaRectangle rect; MetaRectangle rect;
MetaRectangle work_area; MetaRectangle work_area;
retval = FALSE; retval = FALSE;
/* Below each window */ /* Below each window */
below_sorted = g_list_copy (windows); below_sorted = g_list_copy (windows);
below_sorted = g_list_sort (below_sorted, leftmost_cmp); below_sorted = g_list_sort (below_sorted, leftmost_cmp);
below_sorted = g_list_sort (below_sorted, topmost_cmp); below_sorted = g_list_sort (below_sorted, topmost_cmp);
/* To the right of each window */ /* To the right of each window */
right_sorted = g_list_copy (windows); right_sorted = g_list_copy (windows);
@ -545,9 +545,9 @@ find_first_fit (MetaWindow *window,
{ {
*new_x = rect.x; *new_x = rect.x;
*new_y = rect.y; *new_y = rect.y;
retval = TRUE; retval = TRUE;
goto out; goto out;
} }
@ -559,18 +559,18 @@ find_first_fit (MetaWindow *window,
MetaRectangle frame_rect; MetaRectangle frame_rect;
meta_window_get_frame_rect (w, &frame_rect); meta_window_get_frame_rect (w, &frame_rect);
rect.x = frame_rect.x; rect.x = frame_rect.x;
rect.y = frame_rect.y + frame_rect.height; rect.y = frame_rect.y + frame_rect.height;
if (meta_rectangle_contains_rect (&work_area, &rect) && if (meta_rectangle_contains_rect (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, below_sorted)) !rectangle_overlaps_some_window (&rect, below_sorted))
{ {
*new_x = rect.x; *new_x = rect.x;
*new_y = rect.y; *new_y = rect.y;
retval = TRUE; retval = TRUE;
goto out; goto out;
} }
@ -583,26 +583,26 @@ find_first_fit (MetaWindow *window,
{ {
MetaWindow *w = tmp->data; MetaWindow *w = tmp->data;
MetaRectangle frame_rect; MetaRectangle frame_rect;
meta_window_get_frame_rect (w, &frame_rect); meta_window_get_frame_rect (w, &frame_rect);
rect.x = frame_rect.x + frame_rect.width; rect.x = frame_rect.x + frame_rect.width;
rect.y = frame_rect.y; rect.y = frame_rect.y;
if (meta_rectangle_contains_rect (&work_area, &rect) && if (meta_rectangle_contains_rect (&work_area, &rect) &&
!rectangle_overlaps_some_window (&rect, right_sorted)) !rectangle_overlaps_some_window (&rect, right_sorted))
{ {
*new_x = rect.x; *new_x = rect.x;
*new_y = rect.y; *new_y = rect.y;
retval = TRUE; retval = TRUE;
goto out; goto out;
} }
tmp = tmp->next; tmp = tmp->next;
} }
out: out:
g_list_free (below_sorted); g_list_free (below_sorted);
@ -632,7 +632,7 @@ meta_window_place (MetaWindow *window,
case META_WINDOW_MODAL_DIALOG: case META_WINDOW_MODAL_DIALOG:
case META_WINDOW_SPLASHSCREEN: case META_WINDOW_SPLASHSCREEN:
break; break;
/* Assume the app knows best how to place these, no placement /* Assume the app knows best how to place these, no placement
* algorithm ever (other than "leave them as-is") * algorithm ever (other than "leave them as-is")
*/ */
@ -675,7 +675,7 @@ meta_window_place (MetaWindow *window,
case META_WINDOW_MODAL_DIALOG: case META_WINDOW_MODAL_DIALOG:
case META_WINDOW_SPLASHSCREEN: case META_WINDOW_SPLASHSCREEN:
break; break;
/* Assume the app knows best how to place these. */ /* Assume the app knows best how to place these. */
case META_WINDOW_DESKTOP: case META_WINDOW_DESKTOP:
case META_WINDOW_DOCK: case META_WINDOW_DOCK:
@ -702,7 +702,7 @@ meta_window_place (MetaWindow *window,
else else
{ {
/* workarounds enabled */ /* workarounds enabled */
if ((window->size_hints.flags & PPosition) || if ((window->size_hints.flags & PPosition) ||
(window->size_hints.flags & USPosition)) (window->size_hints.flags & USPosition))
{ {
@ -739,17 +739,17 @@ meta_window_place (MetaWindow *window,
meta_topic (META_DEBUG_PLACEMENT, "Centered window %s over transient parent\n", meta_topic (META_DEBUG_PLACEMENT, "Centered window %s over transient parent\n",
window->desc); window->desc);
avoid_being_obscured_as_second_modal_dialog (window, &x, &y); avoid_being_obscured_as_second_modal_dialog (window, &x, &y);
goto done; goto done;
} }
} }
/* FIXME UTILITY with transient set should be stacked up /* FIXME UTILITY with transient set should be stacked up
* on the sides of the parent window or something. * on the sides of the parent window or something.
*/ */
if (window_place_centered (window)) if (window_place_centered (window))
{ {
/* Center on current monitor */ /* Center on current monitor */
@ -769,13 +769,13 @@ meta_window_place (MetaWindow *window,
x += xi->rect.x; x += xi->rect.x;
y += xi->rect.y; y += xi->rect.y;
meta_topic (META_DEBUG_PLACEMENT, "Centered window %s on screen %d monitor %d\n", meta_topic (META_DEBUG_PLACEMENT, "Centered window %s on screen %d monitor %d\n",
window->desc, window->screen->number, xi->number); window->desc, window->screen->number, xi->number);
goto done_check_denied_focus; goto done_check_denied_focus;
} }
/* Find windows that matter (not minimized, on same workspace /* Find windows that matter (not minimized, on same workspace
* as placed window, may be shaded - if shaded we pretend it isn't * as placed window, may be shaded - if shaded we pretend it isn't
* for placement purposes) * for placement purposes)
@ -783,7 +783,7 @@ meta_window_place (MetaWindow *window,
{ {
GSList *all_windows; GSList *all_windows;
GSList *tmp; GSList *tmp;
all_windows = meta_display_list_windows (window->display, META_LIST_DEFAULT); all_windows = meta_display_list_windows (window->display, META_LIST_DEFAULT);
tmp = all_windows; tmp = all_windows;
@ -804,7 +804,7 @@ meta_window_place (MetaWindow *window,
/* Warning, this is a round trip! */ /* Warning, this is a round trip! */
xi = meta_screen_get_current_monitor_info (window->screen); xi = meta_screen_get_current_monitor_info (window->screen);
/* "Origin" placement algorithm */ /* "Origin" placement algorithm */
x = xi->rect.x; x = xi->rect.x;
y = xi->rect.y; y = xi->rect.y;
@ -816,7 +816,7 @@ meta_window_place (MetaWindow *window,
/* Maximize windows if they are too big for their work area (bit of /* Maximize windows if they are too big for their work area (bit of
* a hack here). Assume undecorated windows probably don't intend to * a hack here). Assume undecorated windows probably don't intend to
* be maximized. * be maximized.
*/ */
if (window->has_maximize_func && window->decorated && if (window->has_maximize_func && window->decorated &&
!window->fullscreen) !window->fullscreen)
@ -826,9 +826,9 @@ meta_window_place (MetaWindow *window,
meta_window_get_work_area_for_monitor (window, meta_window_get_work_area_for_monitor (window,
xi->number, xi->number,
&workarea); &workarea);
meta_window_get_frame_rect (window, &frame_rect); meta_window_get_frame_rect (window, &frame_rect);
/* If the window is bigger than the screen, then automaximize. Do NOT /* If the window is bigger than the screen, then automaximize. Do NOT
* auto-maximize the directions independently. See #419810. * auto-maximize the directions independently. See #419810.
*/ */
@ -839,10 +839,10 @@ meta_window_place (MetaWindow *window,
} }
} }
/* If no placement has been done, revert to cascade to avoid /* If no placement has been done, revert to cascade to avoid
* fully overlapping window (e.g. starting multiple terminals) * fully overlapping window (e.g. starting multiple terminals)
* */ * */
if (x == xi->rect.x && y == xi->rect.y) if (x == xi->rect.x && y == xi->rect.y)
find_next_cascade (window, windows, x, y, &x, &y); find_next_cascade (window, windows, x, y, &x, &y);
done_check_denied_focus: done_check_denied_focus:
@ -886,10 +886,10 @@ meta_window_place (MetaWindow *window,
if (!found_fit) if (!found_fit)
find_most_freespace (window, focus_window, x, y, &x, &y); find_most_freespace (window, focus_window, x, y, &x, &y);
} }
done: done:
g_list_free (windows); g_list_free (windows);
done_no_constraints: done_no_constraints:
*new_x = x; *new_x = x;

View File

@ -2,9 +2,9 @@
/* Mutter window placement */ /* Mutter window placement */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -1,6 +1,6 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington, Copyright (C) 2002 Red Hat Inc. * Copyright (C) 2001 Havoc Pennington, Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2006 Elijah Newren * Copyright (C) 2006 Elijah Newren
* Copyright (C) 2008 Thomas Thurman * Copyright (C) 2008 Thomas Thurman
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -615,7 +615,7 @@ handle_preference_init_int (void)
{ {
MetaIntPreference *cursor = preferences_int; MetaIntPreference *cursor = preferences_int;
while (cursor->base.key != NULL) while (cursor->base.key != NULL)
{ {
if (cursor->target) if (cursor->target)
@ -671,7 +671,7 @@ handle_preference_update_bool (GSettings *settings,
* store the current value away. * store the current value away.
*/ */
old_value = *((gboolean *) cursor->target); old_value = *((gboolean *) cursor->target);
/* Now look it up... */ /* Now look it up... */
*((gboolean *) cursor->target) = *((gboolean *) cursor->target) =
g_settings_get_boolean (SETTINGS (cursor->base.schema), key); g_settings_get_boolean (SETTINGS (cursor->base.schema), key);
@ -802,7 +802,7 @@ handle_preference_update_int (GSettings *settings,
} }
} }
/****************************************************************************/ /****************************************************************************/
/* Listeners. */ /* Listeners. */
/****************************************************************************/ /****************************************************************************/
@ -851,7 +851,7 @@ meta_prefs_remove_listener (MetaPrefsChangedFunc func,
return; return;
} }
tmp = tmp->next; tmp = tmp->next;
} }
@ -866,9 +866,9 @@ emit_changed (MetaPreference pref)
meta_topic (META_DEBUG_PREFS, "Notifying listeners that pref %s changed\n", meta_topic (META_DEBUG_PREFS, "Notifying listeners that pref %s changed\n",
meta_preference_to_string (pref)); meta_preference_to_string (pref));
copy = g_list_copy (listeners); copy = g_list_copy (listeners);
tmp = copy; tmp = copy;
while (tmp != NULL) while (tmp != NULL)
@ -890,24 +890,24 @@ changed_idle_handler (gpointer data)
GList *copy; GList *copy;
changed_idle = 0; changed_idle = 0;
copy = g_list_copy (changes); /* reentrancy paranoia */ copy = g_list_copy (changes); /* reentrancy paranoia */
g_list_free (changes); g_list_free (changes);
changes = NULL; changes = NULL;
tmp = copy; tmp = copy;
while (tmp != NULL) while (tmp != NULL)
{ {
MetaPreference pref = GPOINTER_TO_INT (tmp->data); MetaPreference pref = GPOINTER_TO_INT (tmp->data);
emit_changed (pref); emit_changed (pref);
tmp = tmp->next; tmp = tmp->next;
} }
g_list_free (copy); g_list_free (copy);
return FALSE; return FALSE;
} }
@ -915,7 +915,7 @@ static void
queue_changed (MetaPreference pref) queue_changed (MetaPreference pref)
{ {
meta_topic (META_DEBUG_PREFS, "Queueing change of pref %s\n", meta_topic (META_DEBUG_PREFS, "Queueing change of pref %s\n",
meta_preference_to_string (pref)); meta_preference_to_string (pref));
if (g_list_find (changes, GINT_TO_POINTER (pref)) == NULL) if (g_list_find (changes, GINT_TO_POINTER (pref)) == NULL)
changes = g_list_prepend (changes, GINT_TO_POINTER (pref)); changes = g_list_prepend (changes, GINT_TO_POINTER (pref));
@ -931,7 +931,7 @@ queue_changed (MetaPreference pref)
} }
} }
/****************************************************************************/ /****************************************************************************/
/* Initialisation. */ /* Initialisation. */
/****************************************************************************/ /****************************************************************************/
@ -1117,7 +1117,7 @@ meta_prefs_override_preference_schema (const char *key, const char *schema)
do_override (overridden->key, overridden->new_schema); do_override (overridden->key, overridden->new_schema);
} }
/****************************************************************************/ /****************************************************************************/
/* Updates. */ /* Updates. */
/****************************************************************************/ /****************************************************************************/
@ -1194,7 +1194,7 @@ static void
maybe_give_disable_workarounds_warning (void) maybe_give_disable_workarounds_warning (void)
{ {
static gboolean first_disable = TRUE; static gboolean first_disable = TRUE;
if (first_disable && disable_workarounds) if (first_disable && disable_workarounds)
{ {
first_disable = FALSE; first_disable = FALSE;
@ -1261,7 +1261,7 @@ meta_prefs_get_cursor_size (void)
return cursor_size; return cursor_size;
} }
/****************************************************************************/ /****************************************************************************/
/* Handlers for string preferences. */ /* Handlers for string preferences. */
/****************************************************************************/ /****************************************************************************/
@ -1345,7 +1345,7 @@ mouse_button_mods_handler (GVariant *value,
{ {
meta_topic (META_DEBUG_KEYBINDINGS, meta_topic (META_DEBUG_KEYBINDINGS,
"Failed to parse new GSettings value\n"); "Failed to parse new GSettings value\n");
meta_warning ("\"%s\" found in configuration database is " meta_warning ("\"%s\" found in configuration database is "
"not a valid value for mouse button modifier\n", "not a valid value for mouse button modifier\n",
string_value); string_value);
@ -1369,7 +1369,7 @@ mouse_button_mods_handler (GVariant *value,
static gboolean static gboolean
button_layout_equal (const MetaButtonLayout *a, button_layout_equal (const MetaButtonLayout *a,
const MetaButtonLayout *b) const MetaButtonLayout *b)
{ {
int i; int i;
i = 0; i = 0;
@ -1410,7 +1410,7 @@ button_function_from_string (const char *str)
return META_BUTTON_FUNCTION_ABOVE; return META_BUTTON_FUNCTION_ABOVE;
else if (strcmp (str, "stick") == 0) else if (strcmp (str, "stick") == 0)
return META_BUTTON_FUNCTION_STICK; return META_BUTTON_FUNCTION_STICK;
else else
/* don't know; give up */ /* don't know; give up */
return META_BUTTON_FUNCTION_LAST; return META_BUTTON_FUNCTION_LAST;
} }
@ -1535,7 +1535,7 @@ button_layout_handler (GVariant *value,
new_layout.right_buttons_has_spacer[i] = FALSE; new_layout.right_buttons_has_spacer[i] = FALSE;
++i; ++i;
} }
buttons = g_strsplit (sides[1], ",", -1); buttons = g_strsplit (sides[1], ",", -1);
i = 0; i = 0;
b = 0; b = 0;
@ -1571,7 +1571,7 @@ button_layout_handler (GVariant *value,
buttons[b]); buttons[b]);
} }
} }
++b; ++b;
} }
@ -1585,13 +1585,13 @@ button_layout_handler (GVariant *value,
} }
g_strfreev (sides); g_strfreev (sides);
/* Invert the button layout for RTL languages */ /* Invert the button layout for RTL languages */
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL) if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
{ {
MetaButtonLayout rtl_layout; MetaButtonLayout rtl_layout;
int j; int j;
for (i = 0; new_layout.left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++); for (i = 0; new_layout.left_buttons[i] != META_BUTTON_FUNCTION_LAST; i++);
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
@ -1606,7 +1606,7 @@ button_layout_handler (GVariant *value,
rtl_layout.right_buttons[j] = META_BUTTON_FUNCTION_LAST; rtl_layout.right_buttons[j] = META_BUTTON_FUNCTION_LAST;
rtl_layout.right_buttons_has_spacer[j] = FALSE; rtl_layout.right_buttons_has_spacer[j] = FALSE;
} }
for (i = 0; new_layout.right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++); for (i = 0; new_layout.right_buttons[i] != META_BUTTON_FUNCTION_LAST; i++);
for (j = 0; j < i; j++) for (j = 0; j < i; j++)
{ {
@ -1751,7 +1751,7 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_RAISE_ON_CLICK: case META_PREF_RAISE_ON_CLICK:
return "RAISE_ON_CLICK"; return "RAISE_ON_CLICK";
case META_PREF_THEME: case META_PREF_THEME:
return "THEME"; return "THEME";
@ -1778,7 +1778,7 @@ meta_preference_to_string (MetaPreference pref)
case META_PREF_AUTO_RAISE: case META_PREF_AUTO_RAISE:
return "AUTO_RAISE"; return "AUTO_RAISE";
case META_PREF_AUTO_RAISE_DELAY: case META_PREF_AUTO_RAISE_DELAY:
return "AUTO_RAISE_DELAY"; return "AUTO_RAISE_DELAY";
@ -2021,7 +2021,7 @@ meta_prefs_change_workspace_name (int num,
{ {
GVariantBuilder builder; GVariantBuilder builder;
int n_workspace_names, i; int n_workspace_names, i;
g_return_if_fail (num >= 0); g_return_if_fail (num >= 0);
meta_topic (META_DEBUG_PREFS, meta_topic (META_DEBUG_PREFS,
@ -2181,7 +2181,7 @@ meta_prefs_get_keybindings ()
return g_hash_table_get_values (key_bindings); return g_hash_table_get_values (key_bindings);
} }
void void
meta_prefs_get_overlay_binding (MetaKeyCombo *combo) meta_prefs_get_overlay_binding (MetaKeyCombo *combo)
{ {
*combo = overlay_key_combo; *combo = overlay_key_combo;

View File

@ -9,11 +9,11 @@
* which the rest of the world is allowed to use.) * which the rest of the world is allowed to use.)
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -23,7 +23,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -73,7 +73,7 @@ struct _MetaScreen
* any actual clients * any actual clients
*/ */
Window no_focus_window; Window no_focus_window;
GList *workspaces; GList *workspaces;
MetaStack *stack; MetaStack *stack;
@ -110,11 +110,11 @@ struct _MetaScreen
MetaScreenCorner starting_corner; MetaScreenCorner starting_corner;
guint vertical_workspaces : 1; guint vertical_workspaces : 1;
guint workspace_layout_overridden : 1; guint workspace_layout_overridden : 1;
guint keys_grabbed : 1; guint keys_grabbed : 1;
int closing; int closing;
/* Instead of unmapping withdrawn windows we can leave them mapped /* Instead of unmapping withdrawn windows we can leave them mapped
* and restack them below a guard window. When using a compositor * and restack them below a guard window. When using a compositor
* this allows us to provide live previews of unmapped windows */ * this allows us to provide live previews of unmapped windows */

View File

@ -1,13 +1,13 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001, 2002 Havoc Pennington * Copyright (C) 2001, 2002 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat Inc. * Copyright (C) 2002, 2003 Red Hat Inc.
* Some ICCCM manager selection code derived from fvwm2, * Some ICCCM manager selection code derived from fvwm2,
* Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team * Copyright (C) 2001 Dominik Vogt, Matthias Clasen, and fvwm2 team
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -17,7 +17,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -267,7 +267,7 @@ set_wm_check_hint (MetaScreen *screen)
unsigned long data[1]; unsigned long data[1];
g_return_val_if_fail (screen->display->leader_window != None, 0); g_return_val_if_fail (screen->display->leader_window != None, 0);
data[0] = screen->display->leader_window; data[0] = screen->display->leader_window;
XChangeProperty (screen->display->xdisplay, screen->xroot, XChangeProperty (screen->display->xdisplay, screen->xroot,
@ -281,7 +281,7 @@ set_wm_check_hint (MetaScreen *screen)
static void static void
unset_wm_check_hint (MetaScreen *screen) unset_wm_check_hint (MetaScreen *screen)
{ {
XDeleteProperty (screen->display->xdisplay, screen->xroot, XDeleteProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom__NET_SUPPORTING_WM_CHECK); screen->display->atom__NET_SUPPORTING_WM_CHECK);
} }
@ -303,7 +303,7 @@ set_supported_hint (MetaScreen *screen)
XA_ATOM, XA_ATOM,
32, PropModeReplace, 32, PropModeReplace,
(guchar*) atoms, G_N_ELEMENTS(atoms)); (guchar*) atoms, G_N_ELEMENTS(atoms));
return Success; return Success;
} }
@ -327,12 +327,12 @@ set_wm_icon_size_hint (MetaScreen *screen)
vals[4] = 0; vals[4] = 0;
vals[5] = 0; vals[5] = 0;
#undef LEGACY_ICON_SIZE #undef LEGACY_ICON_SIZE
XChangeProperty (screen->display->xdisplay, screen->xroot, XChangeProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom_WM_ICON_SIZE, screen->display->atom_WM_ICON_SIZE,
XA_CARDINAL, XA_CARDINAL,
32, PropModeReplace, (guchar*) vals, N_VALS); 32, PropModeReplace, (guchar*) vals, N_VALS);
return Success; return Success;
#undef N_VALS #undef N_VALS
} }
@ -411,7 +411,7 @@ reload_monitor_infos (MetaScreen *screen)
MetaWorkspace *space = tmp->data; MetaWorkspace *space = tmp->data;
meta_workspace_invalidate_work_area (space); meta_workspace_invalidate_work_area (space);
tmp = tmp->next; tmp = tmp->next;
} }
@ -506,16 +506,16 @@ meta_screen_new (MetaDisplay *display,
guint32 manager_timestamp; guint32 manager_timestamp;
gulong current_workspace; gulong current_workspace;
MetaMonitorManager *manager; MetaMonitorManager *manager;
replace_current_wm = meta_get_replace_current_wm (); replace_current_wm = meta_get_replace_current_wm ();
/* Only display->name, display->xdisplay, and display->error_traps /* Only display->name, display->xdisplay, and display->error_traps
* can really be used in this function, since normally screens are * can really be used in this function, since normally screens are
* created from the MetaDisplay constructor * created from the MetaDisplay constructor
*/ */
xdisplay = display->xdisplay; xdisplay = display->xdisplay;
meta_verbose ("Trying screen %d on display '%s'\n", meta_verbose ("Trying screen %d on display '%s'\n",
number, display->name); number, display->name);
@ -532,14 +532,14 @@ meta_screen_new (MetaDisplay *display,
} }
sprintf (buf, "WM_S%d", number); sprintf (buf, "WM_S%d", number);
wm_sn_atom = XInternAtom (xdisplay, buf, False); wm_sn_atom = XInternAtom (xdisplay, buf, False);
current_wm_sn_owner = XGetSelectionOwner (xdisplay, wm_sn_atom); current_wm_sn_owner = XGetSelectionOwner (xdisplay, wm_sn_atom);
if (current_wm_sn_owner != None) if (current_wm_sn_owner != None)
{ {
XSetWindowAttributes attrs; XSetWindowAttributes attrs;
if (!replace_current_wm) if (!replace_current_wm)
{ {
meta_warning (_("Screen %d on display \"%s\" already has a window manager; try using the --replace option to replace the current window manager.\n"), meta_warning (_("Screen %d on display \"%s\" already has a window manager; try using the --replace option to replace the current window manager.\n"),
@ -563,7 +563,7 @@ meta_screen_new (MetaDisplay *display,
new_wm_sn_owner = meta_create_offscreen_window (xdisplay, xroot, NoEventMask); new_wm_sn_owner = meta_create_offscreen_window (xdisplay, xroot, NoEventMask);
manager_timestamp = timestamp; manager_timestamp = timestamp;
XSetSelectionOwner (xdisplay, wm_sn_atom, new_wm_sn_owner, XSetSelectionOwner (xdisplay, wm_sn_atom, new_wm_sn_owner,
manager_timestamp); manager_timestamp);
@ -573,14 +573,14 @@ meta_screen_new (MetaDisplay *display,
number, display->name); number, display->name);
XDestroyWindow (xdisplay, new_wm_sn_owner); XDestroyWindow (xdisplay, new_wm_sn_owner);
return NULL; return NULL;
} }
{ {
/* Send client message indicating that we are now the WM */ /* Send client message indicating that we are now the WM */
XClientMessageEvent ev; XClientMessageEvent ev;
ev.type = ClientMessage; ev.type = ClientMessage;
ev.window = xroot; ev.window = xroot;
ev.message_type = display->atom_MANAGER; ev.message_type = display->atom_MANAGER;
@ -597,7 +597,7 @@ meta_screen_new (MetaDisplay *display,
XEvent event; XEvent event;
/* We sort of block infinitely here which is probably lame. */ /* We sort of block infinitely here which is probably lame. */
meta_verbose ("Waiting for old window manager to exit\n"); meta_verbose ("Waiting for old window manager to exit\n");
do do
{ {
@ -606,7 +606,7 @@ meta_screen_new (MetaDisplay *display,
} }
while (event.type != DestroyNotify); while (event.type != DestroyNotify);
} }
/* select our root window events */ /* select our root window events */
meta_error_trap_push (display); meta_error_trap_push (display);
@ -651,13 +651,13 @@ meta_screen_new (MetaDisplay *display,
number, display->name); number, display->name);
XDestroyWindow (xdisplay, new_wm_sn_owner); XDestroyWindow (xdisplay, new_wm_sn_owner);
return NULL; return NULL;
} }
screen = g_object_new (META_TYPE_SCREEN, NULL); screen = g_object_new (META_TYPE_SCREEN, NULL);
screen->closing = 0; screen->closing = 0;
screen->display = display; screen->display = display;
screen->number = number; screen->number = number;
screen->screen_name = get_screen_name (display, number); screen->screen_name = get_screen_name (display, number);
@ -681,8 +681,8 @@ meta_screen_new (MetaDisplay *display,
screen->wm_sn_atom = wm_sn_atom; screen->wm_sn_atom = wm_sn_atom;
screen->wm_sn_timestamp = manager_timestamp; screen->wm_sn_timestamp = manager_timestamp;
screen->wm_cm_selection_window = meta_create_offscreen_window (xdisplay, screen->wm_cm_selection_window = meta_create_offscreen_window (xdisplay,
xroot, xroot,
NoEventMask); NoEventMask);
screen->work_area_later = 0; screen->work_area_later = 0;
screen->check_fullscreen_later = 0; screen->check_fullscreen_later = 0;
@ -699,18 +699,18 @@ meta_screen_new (MetaDisplay *display,
meta_screen_set_cursor (screen, META_CURSOR_DEFAULT); meta_screen_set_cursor (screen, META_CURSOR_DEFAULT);
/* Handle creating a no_focus_window for this screen */ /* Handle creating a no_focus_window for this screen */
screen->no_focus_window = screen->no_focus_window =
meta_create_offscreen_window (display->xdisplay, meta_create_offscreen_window (display->xdisplay,
screen->xroot, screen->xroot,
FocusChangeMask|KeyPressMask|KeyReleaseMask); FocusChangeMask|KeyPressMask|KeyReleaseMask);
XMapWindow (display->xdisplay, screen->no_focus_window); XMapWindow (display->xdisplay, screen->no_focus_window);
/* Done with no_focus_window stuff */ /* Done with no_focus_window stuff */
set_wm_icon_size_hint (screen); set_wm_icon_size_hint (screen);
set_supported_hint (screen); set_supported_hint (screen);
set_wm_check_hint (screen); set_wm_check_hint (screen);
set_desktop_viewport_hint (screen); set_desktop_viewport_hint (screen);
@ -729,13 +729,13 @@ meta_screen_new (MetaDisplay *display,
(int) current_workspace); (int) current_workspace);
else else
meta_verbose ("No _NET_CURRENT_DESKTOP present\n"); meta_verbose ("No _NET_CURRENT_DESKTOP present\n");
/* Screens must have at least one workspace at all times, /* Screens must have at least one workspace at all times,
* so create that required workspace. * so create that required workspace.
*/ */
meta_workspace_activate (meta_workspace_new (screen), timestamp); meta_workspace_activate (meta_workspace_new (screen), timestamp);
update_num_workspaces (screen, timestamp); update_num_workspaces (screen, timestamp);
set_workspace_names (screen); set_workspace_names (screen);
screen->keys_grabbed = FALSE; screen->keys_grabbed = FALSE;
@ -765,10 +765,10 @@ meta_screen_new (MetaDisplay *display,
/* Switch to the _NET_CURRENT_DESKTOP workspace */ /* Switch to the _NET_CURRENT_DESKTOP workspace */
{ {
MetaWorkspace *space; MetaWorkspace *space;
space = meta_screen_get_workspace_by_index (screen, space = meta_screen_get_workspace_by_index (screen,
current_workspace); current_workspace);
if (space != NULL) if (space != NULL)
meta_workspace_activate (space, timestamp); meta_workspace_activate (space, timestamp);
} }
@ -788,15 +788,15 @@ meta_screen_free (MetaScreen *screen,
display = screen->display; display = screen->display;
screen->closing += 1; screen->closing += 1;
meta_display_grab (display); meta_display_grab (display);
meta_compositor_unmanage (screen->display->compositor); meta_compositor_unmanage (screen->display->compositor);
meta_display_unmanage_windows_for_screen (display, screen, timestamp); meta_display_unmanage_windows_for_screen (display, screen, timestamp);
meta_prefs_remove_listener (prefs_changed_callback, screen); meta_prefs_remove_listener (prefs_changed_callback, screen);
meta_screen_ungrab_keys (screen); meta_screen_ungrab_keys (screen);
#ifdef HAVE_STARTUP_NOTIFICATION #ifdef HAVE_STARTUP_NOTIFICATION
@ -816,7 +816,7 @@ meta_screen_free (MetaScreen *screen,
screen->sn_context = NULL; screen->sn_context = NULL;
} }
#endif #endif
meta_ui_free (screen->ui); meta_ui_free (screen->ui);
meta_stack_free (screen->stack); meta_stack_free (screen->stack);
@ -832,7 +832,7 @@ meta_screen_free (MetaScreen *screen,
XDestroyWindow (screen->display->xdisplay, XDestroyWindow (screen->display->xdisplay,
screen->wm_sn_selection_window); screen->wm_sn_selection_window);
if (screen->work_area_later != 0) if (screen->work_area_later != 0)
meta_later_remove (screen->work_area_later); meta_later_remove (screen->work_area_later);
if (screen->check_fullscreen_later != 0) if (screen->check_fullscreen_later != 0)
@ -887,7 +887,7 @@ prefs_changed_callback (MetaPreference pref,
gpointer data) gpointer data)
{ {
MetaScreen *screen = data; MetaScreen *screen = data;
if ((pref == META_PREF_NUM_WORKSPACES || if ((pref == META_PREF_NUM_WORKSPACES ||
pref == META_PREF_DYNAMIC_WORKSPACES) && pref == META_PREF_DYNAMIC_WORKSPACES) &&
!meta_prefs_get_dynamic_workspaces ()) !meta_prefs_get_dynamic_workspaces ())
@ -895,7 +895,7 @@ prefs_changed_callback (MetaPreference pref,
/* GSettings doesn't provide timestamps, but luckily update_num_workspaces /* GSettings doesn't provide timestamps, but luckily update_num_workspaces
* often doesn't need it... * often doesn't need it...
*/ */
guint32 timestamp = guint32 timestamp =
meta_display_get_current_time_roundtrip (screen->display); meta_display_get_current_time_roundtrip (screen->display);
update_num_workspaces (screen, timestamp); update_num_workspaces (screen, timestamp);
} }
@ -917,7 +917,7 @@ get_screen_name (MetaDisplay *display,
char *p; char *p;
char *dname; char *dname;
char *scr; char *scr;
/* DisplayString gives us a sort of canonical display, /* DisplayString gives us a sort of canonical display,
* vs. the user-entered name from XDisplayName() * vs. the user-entered name from XDisplayName()
*/ */
@ -932,7 +932,7 @@ get_screen_name (MetaDisplay *display,
if (p) if (p)
*p = '\0'; *p = '\0';
} }
scr = g_strdup_printf ("%s.%d", dname, number); scr = g_strdup_printf ("%s.%d", dname, number);
g_free (dname); g_free (dname);
@ -955,7 +955,7 @@ static void
listify_func (gpointer key, gpointer value, gpointer data) listify_func (gpointer key, gpointer value, gpointer data)
{ {
GSList **listp; GSList **listp;
listp = data; listp = data;
*listp = g_slist_prepend (*listp, value); *listp = g_slist_prepend (*listp, value);
@ -981,14 +981,14 @@ meta_screen_foreach_window (MetaScreen *screen,
/* If we end up doing this often, just keeping a list /* If we end up doing this often, just keeping a list
* of windows might be sensible. * of windows might be sensible.
*/ */
winlist = NULL; winlist = NULL;
g_hash_table_foreach (screen->display->xids, g_hash_table_foreach (screen->display->xids,
listify_func, listify_func,
&winlist); &winlist);
winlist = g_slist_sort (winlist, ptrcmp); winlist = g_slist_sort (winlist, ptrcmp);
tmp = winlist; tmp = winlist;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -1005,7 +1005,7 @@ meta_screen_foreach_window (MetaScreen *screen,
!window->override_redirect) !window->override_redirect)
(* func) (screen, window, data); (* func) (screen, window, data);
} }
tmp = tmp->next; tmp = tmp->next;
} }
g_slist_free (winlist); g_slist_free (winlist);
@ -1039,7 +1039,7 @@ meta_screen_get_workspace_by_index (MetaScreen *screen,
/* should be robust, idx is maybe from an app */ /* should be robust, idx is maybe from an app */
if (idx < 0) if (idx < 0)
return NULL; return NULL;
i = 0; i = 0;
tmp = screen->workspaces; tmp = screen->workspaces;
while (tmp != NULL) while (tmp != NULL)
@ -1258,7 +1258,7 @@ update_num_workspaces (MetaScreen *screen,
GList *extras; GList *extras;
MetaWorkspace *last_remaining; MetaWorkspace *last_remaining;
gboolean need_change_space; gboolean need_change_space;
if (meta_prefs_get_dynamic_workspaces ()) if (meta_prefs_get_dynamic_workspaces ())
{ {
int n_items; int n_items;
@ -1301,14 +1301,14 @@ update_num_workspaces (MetaScreen *screen,
extras = g_list_prepend (extras, w); extras = g_list_prepend (extras, w);
else else
last_remaining = w; last_remaining = w;
++i; ++i;
tmp = tmp->next; tmp = tmp->next;
} }
old_num = i; old_num = i;
g_assert (last_remaining); g_assert (last_remaining);
/* Get rid of the extra workspaces by moving all their windows /* Get rid of the extra workspaces by moving all their windows
* to last_remaining, then activating last_remaining if * to last_remaining, then activating last_remaining if
* one of the removed workspaces was active. This will be a bit * one of the removed workspaces was active. This will be a bit
@ -1321,11 +1321,11 @@ update_num_workspaces (MetaScreen *screen,
{ {
MetaWorkspace *w = tmp->data; MetaWorkspace *w = tmp->data;
meta_workspace_relocate_windows (w, last_remaining); meta_workspace_relocate_windows (w, last_remaining);
if (w == screen->active_workspace) if (w == screen->active_workspace)
need_change_space = TRUE; need_change_space = TRUE;
tmp = tmp->next; tmp = tmp->next;
} }
@ -1551,7 +1551,7 @@ meta_screen_get_monitor_for_window (MetaScreen *screen,
MetaWindow *window) MetaWindow *window)
{ {
MetaRectangle window_rect; MetaRectangle window_rect;
meta_window_get_frame_rect (window, &window_rect); meta_window_get_frame_rect (window, &window_rect);
return meta_screen_get_monitor_for_rect (screen, &window_rect); return meta_screen_get_monitor_for_rect (screen, &window_rect);
@ -1565,7 +1565,7 @@ meta_screen_get_monitor_index_for_rect (MetaScreen *screen,
return monitor->number; return monitor->number;
} }
const MetaMonitorInfo* const MetaMonitorInfo*
meta_screen_get_monitor_neighbor (MetaScreen *screen, meta_screen_get_monitor_neighbor (MetaScreen *screen,
int which_monitor, int which_monitor,
MetaScreenDirection direction) MetaScreenDirection direction)
@ -1578,23 +1578,23 @@ meta_screen_get_monitor_neighbor (MetaScreen *screen,
{ {
current = screen->monitor_infos + i; current = screen->monitor_infos + i;
if ((direction == META_SCREEN_RIGHT && if ((direction == META_SCREEN_RIGHT &&
current->rect.x == input->rect.x + input->rect.width && current->rect.x == input->rect.x + input->rect.width &&
meta_rectangle_vert_overlap(&current->rect, &input->rect)) || meta_rectangle_vert_overlap(&current->rect, &input->rect)) ||
(direction == META_SCREEN_LEFT && (direction == META_SCREEN_LEFT &&
input->rect.x == current->rect.x + current->rect.width && input->rect.x == current->rect.x + current->rect.width &&
meta_rectangle_vert_overlap(&current->rect, &input->rect)) || meta_rectangle_vert_overlap(&current->rect, &input->rect)) ||
(direction == META_SCREEN_UP && (direction == META_SCREEN_UP &&
input->rect.y == current->rect.y + current->rect.height && input->rect.y == current->rect.y + current->rect.height &&
meta_rectangle_horiz_overlap(&current->rect, &input->rect)) || meta_rectangle_horiz_overlap(&current->rect, &input->rect)) ||
(direction == META_SCREEN_DOWN && (direction == META_SCREEN_DOWN &&
current->rect.y == input->rect.y + input->rect.height && current->rect.y == input->rect.y + input->rect.height &&
meta_rectangle_horiz_overlap(&current->rect, &input->rect))) meta_rectangle_horiz_overlap(&current->rect, &input->rect)))
{ {
return current; return current;
} }
} }
return NULL; return NULL;
} }
@ -1634,7 +1634,7 @@ meta_screen_get_natural_monitor_list (MetaScreen *screen,
while (!g_queue_is_empty (monitor_queue)) while (!g_queue_is_empty (monitor_queue))
{ {
current = (const MetaMonitorInfo*) current = (const MetaMonitorInfo*)
g_queue_pop_head (monitor_queue); g_queue_pop_head (monitor_queue);
(*monitors_list)[cur++] = current->number; (*monitors_list)[cur++] = current->number;
@ -1775,10 +1775,10 @@ meta_screen_get_current_monitor (MetaScreen *screen)
if (screen->n_monitor_infos == 1) if (screen->n_monitor_infos == 1)
return 0; return 0;
/* Sadly, we have to do it this way. Yuck. /* Sadly, we have to do it this way. Yuck.
*/ */
if (screen->display->monitor_cache_invalidated) if (screen->display->monitor_cache_invalidated)
{ {
int x, y; int x, y;
@ -1858,7 +1858,7 @@ meta_screen_update_workspace_layout (MetaScreen *screen)
if (screen->workspace_layout_overridden) if (screen->workspace_layout_overridden)
return; return;
list = NULL; list = NULL;
n_items = 0; n_items = 0;
@ -1870,7 +1870,7 @@ meta_screen_update_workspace_layout (MetaScreen *screen)
if (n_items == 3 || n_items == 4) if (n_items == 3 || n_items == 4)
{ {
int cols, rows; int cols, rows;
switch (list[0]) switch (list[0])
{ {
case _NET_WM_ORIENTATION_HORZ: case _NET_WM_ORIENTATION_HORZ:
@ -1897,7 +1897,7 @@ meta_screen_update_workspace_layout (MetaScreen *screen)
screen->rows_of_workspaces = rows; screen->rows_of_workspaces = rows;
else else
screen->rows_of_workspaces = -1; screen->rows_of_workspaces = -1;
if (cols > 0) if (cols > 0)
screen->columns_of_workspaces = cols; screen->columns_of_workspaces = cols;
else else
@ -2007,10 +2007,10 @@ set_workspace_names (MetaScreen *screen)
strlen (name) + 1); strlen (name) + 1);
else else
g_string_append_len (flattened, "", 1); g_string_append_len (flattened, "", 1);
++i; ++i;
} }
meta_error_trap_push (screen->display); meta_error_trap_push (screen->display);
XChangeProperty (screen->display->xdisplay, XChangeProperty (screen->display->xdisplay,
screen->xroot, screen->xroot,
@ -2019,7 +2019,7 @@ set_workspace_names (MetaScreen *screen)
8, PropModeReplace, 8, PropModeReplace,
(unsigned char *)flattened->str, flattened->len); (unsigned char *)flattened->str, flattened->len);
meta_error_trap_pop (screen->display); meta_error_trap_pop (screen->display);
g_string_free (flattened, TRUE); g_string_free (flattened, TRUE);
} }
@ -2033,7 +2033,7 @@ meta_screen_update_workspace_names (MetaScreen *screen)
/* this updates names in prefs when the root window property changes, /* this updates names in prefs when the root window property changes,
* iff the new property contents don't match what's already in prefs * iff the new property contents don't match what's already in prefs
*/ */
names = NULL; names = NULL;
n_names = 0; n_names = 0;
if (!meta_prop_get_utf8_list (screen->display, if (!meta_prop_get_utf8_list (screen->display,
@ -2053,10 +2053,10 @@ meta_screen_update_workspace_names (MetaScreen *screen)
"Setting workspace %d name to \"%s\" due to _NET_DESKTOP_NAMES change\n", "Setting workspace %d name to \"%s\" due to _NET_DESKTOP_NAMES change\n",
i, names[i] ? names[i] : "null"); i, names[i] ? names[i] : "null");
meta_prefs_change_workspace_name (i, names[i]); meta_prefs_change_workspace_name (i, names[i]);
++i; ++i;
} }
g_strfreev (names); g_strfreev (names);
} }
@ -2073,7 +2073,7 @@ meta_create_offscreen_window (Display *xdisplay,
*/ */
attrs.override_redirect = True; attrs.override_redirect = True;
attrs.event_mask = valuemask; attrs.event_mask = valuemask;
return XCreateWindow (xdisplay, return XCreateWindow (xdisplay,
parent, parent,
-100, -100, 1, 1, -100, -100, 1, 1,
@ -2092,12 +2092,12 @@ set_work_area_hint (MetaScreen *screen)
GList *tmp_list; GList *tmp_list;
unsigned long *data, *tmp; unsigned long *data, *tmp;
MetaRectangle area; MetaRectangle area;
num_workspaces = meta_screen_get_n_workspaces (screen); num_workspaces = meta_screen_get_n_workspaces (screen);
data = g_new (unsigned long, num_workspaces * 4); data = g_new (unsigned long, num_workspaces * 4);
tmp_list = screen->workspaces; tmp_list = screen->workspaces;
tmp = data; tmp = data;
while (tmp_list != NULL) while (tmp_list != NULL)
{ {
MetaWorkspace *workspace = tmp_list->data; MetaWorkspace *workspace = tmp_list->data;
@ -2112,10 +2112,10 @@ set_work_area_hint (MetaScreen *screen)
tmp += 4; tmp += 4;
} }
tmp_list = tmp_list->next; tmp_list = tmp_list->next;
} }
meta_error_trap_push (screen->display); meta_error_trap_push (screen->display);
XChangeProperty (screen->display->xdisplay, screen->xroot, XChangeProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom__NET_WORKAREA, screen->display->atom__NET_WORKAREA,
@ -2132,11 +2132,11 @@ set_work_area_later_func (MetaScreen *screen)
{ {
meta_topic (META_DEBUG_WORKAREA, meta_topic (META_DEBUG_WORKAREA,
"Running work area hint computation function\n"); "Running work area hint computation function\n");
screen->work_area_later = 0; screen->work_area_later = 0;
set_work_area_hint (screen); set_work_area_hint (screen);
return FALSE; return FALSE;
} }
@ -2188,7 +2188,7 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
int *grid; int *grid;
int i, r, c; int i, r, c;
int current_row, current_col; int current_row, current_col;
rows = screen->rows_of_workspaces; rows = screen->rows_of_workspaces;
cols = screen->columns_of_workspaces; cols = screen->columns_of_workspaces;
if (rows <= 0 && cols <= 0) if (rows <= 0 && cols <= 0)
@ -2206,58 +2206,58 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
cols = 1; cols = 1;
g_assert (rows != 0 && cols != 0); g_assert (rows != 0 && cols != 0);
grid_area = rows * cols; grid_area = rows * cols;
meta_verbose ("Getting layout rows = %d cols = %d current = %d " meta_verbose ("Getting layout rows = %d cols = %d current = %d "
"num_spaces = %d vertical = %s corner = %s\n", "num_spaces = %d vertical = %s corner = %s\n",
rows, cols, current_space, num_workspaces, rows, cols, current_space, num_workspaces,
screen->vertical_workspaces ? "(true)" : "(false)", screen->vertical_workspaces ? "(true)" : "(false)",
meta_screen_corner_to_string (screen->starting_corner)); meta_screen_corner_to_string (screen->starting_corner));
/* ok, we want to setup the distances in the workspace array to go /* ok, we want to setup the distances in the workspace array to go
* in each direction. Remember, there are many ways that a workspace * in each direction. Remember, there are many ways that a workspace
* array can be setup. * array can be setup.
* see http://www.freedesktop.org/standards/wm-spec/1.2/html/x109.html * see http://www.freedesktop.org/standards/wm-spec/1.2/html/x109.html
* and look at the _NET_DESKTOP_LAYOUT section for details. * and look at the _NET_DESKTOP_LAYOUT section for details.
* For instance: * For instance:
*/ */
/* starting_corner = META_SCREEN_TOPLEFT /* starting_corner = META_SCREEN_TOPLEFT
* vertical_workspaces = 0 vertical_workspaces=1 * vertical_workspaces = 0 vertical_workspaces=1
* 1234 1357 * 1234 1357
* 5678 2468 * 5678 2468
* *
* starting_corner = META_SCREEN_TOPRIGHT * starting_corner = META_SCREEN_TOPRIGHT
* vertical_workspaces = 0 vertical_workspaces=1 * vertical_workspaces = 0 vertical_workspaces=1
* 4321 7531 * 4321 7531
* 8765 8642 * 8765 8642
* *
* starting_corner = META_SCREEN_BOTTOMLEFT * starting_corner = META_SCREEN_BOTTOMLEFT
* vertical_workspaces = 0 vertical_workspaces=1 * vertical_workspaces = 0 vertical_workspaces=1
* 5678 2468 * 5678 2468
* 1234 1357 * 1234 1357
* *
* starting_corner = META_SCREEN_BOTTOMRIGHT * starting_corner = META_SCREEN_BOTTOMRIGHT
* vertical_workspaces = 0 vertical_workspaces=1 * vertical_workspaces = 0 vertical_workspaces=1
* 8765 8642 * 8765 8642
* 4321 7531 * 4321 7531
* *
*/ */
/* keep in mind that we could have a ragged layout, e.g. the "8" /* keep in mind that we could have a ragged layout, e.g. the "8"
* in the above grids could be missing * in the above grids could be missing
*/ */
grid = g_new (int, grid_area); grid = g_new (int, grid_area);
current_row = -1; current_row = -1;
current_col = -1; current_col = -1;
i = 0; i = 0;
switch (screen->starting_corner) switch (screen->starting_corner)
{ {
case META_SCREEN_TOPLEFT: case META_SCREEN_TOPLEFT:
if (screen->vertical_workspaces) if (screen->vertical_workspaces)
{ {
c = 0; c = 0;
while (c < cols) while (c < cols)
@ -2289,7 +2289,7 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
} }
break; break;
case META_SCREEN_TOPRIGHT: case META_SCREEN_TOPRIGHT:
if (screen->vertical_workspaces) if (screen->vertical_workspaces)
{ {
c = cols - 1; c = cols - 1;
while (c >= 0) while (c >= 0)
@ -2321,7 +2321,7 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
} }
break; break;
case META_SCREEN_BOTTOMLEFT: case META_SCREEN_BOTTOMLEFT:
if (screen->vertical_workspaces) if (screen->vertical_workspaces)
{ {
c = 0; c = 0;
while (c < cols) while (c < cols)
@ -2353,7 +2353,7 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
} }
break; break;
case META_SCREEN_BOTTOMRIGHT: case META_SCREEN_BOTTOMRIGHT:
if (screen->vertical_workspaces) if (screen->vertical_workspaces)
{ {
c = cols - 1; c = cols - 1;
while (c >= 0) while (c >= 0)
@ -2384,12 +2384,12 @@ meta_screen_calc_workspace_layout (MetaScreen *screen,
} }
} }
break; break;
} }
if (i != grid_area) if (i != grid_area)
meta_bug ("did not fill in the whole workspace grid in %s (%d filled)\n", meta_bug ("did not fill in the whole workspace grid in %s (%d filled)\n",
G_STRFUNC, i); G_STRFUNC, i);
current_row = 0; current_row = 0;
current_col = 0; current_col = 0;
r = 0; r = 0;
@ -2525,7 +2525,7 @@ meta_screen_update_showing_desktop_hint (MetaScreen *screen)
unsigned long data[1]; unsigned long data[1];
data[0] = screen->active_workspace->showing_desktop ? 1 : 0; data[0] = screen->active_workspace->showing_desktop ? 1 : 0;
meta_error_trap_push (screen->display); meta_error_trap_push (screen->display);
XChangeProperty (screen->display->xdisplay, screen->xroot, XChangeProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom__NET_SHOWING_DESKTOP, screen->display->atom__NET_SHOWING_DESKTOP,
@ -2553,7 +2553,7 @@ queue_windows_showing (MetaScreen *screen)
if (w->screen == screen) if (w->screen == screen)
meta_window_queue (w, META_QUEUE_CALC_SHOWING); meta_window_queue (w, META_QUEUE_CALC_SHOWING);
tmp = tmp->next; tmp = tmp->next;
} }
@ -2568,32 +2568,32 @@ meta_screen_minimize_all_on_active_workspace_except (MetaScreen *screen,
GList *tmp; GList *tmp;
windows = screen->active_workspace->windows; windows = screen->active_workspace->windows;
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *w = tmp->data; MetaWindow *w = tmp->data;
if (w->screen == screen && if (w->screen == screen &&
w->has_minimize_func && w->has_minimize_func &&
w != keep) w != keep)
meta_window_minimize (w); meta_window_minimize (w);
tmp = tmp->next; tmp = tmp->next;
} }
} }
void void
meta_screen_show_desktop (MetaScreen *screen, meta_screen_show_desktop (MetaScreen *screen,
guint32 timestamp) guint32 timestamp)
{ {
GList *windows; GList *windows;
if (screen->active_workspace->showing_desktop) if (screen->active_workspace->showing_desktop)
return; return;
screen->active_workspace->showing_desktop = TRUE; screen->active_workspace->showing_desktop = TRUE;
queue_windows_showing (screen); queue_windows_showing (screen);
/* Focus the most recently used META_WINDOW_DESKTOP window, if there is one; /* Focus the most recently used META_WINDOW_DESKTOP window, if there is one;
@ -2603,18 +2603,18 @@ meta_screen_show_desktop (MetaScreen *screen,
while (windows != NULL) while (windows != NULL)
{ {
MetaWindow *w = windows->data; MetaWindow *w = windows->data;
if (w->screen == screen && if (w->screen == screen &&
w->type == META_WINDOW_DESKTOP) w->type == META_WINDOW_DESKTOP)
{ {
meta_window_focus (w, timestamp); meta_window_focus (w, timestamp);
break; break;
} }
windows = windows->next; windows = windows->next;
} }
meta_screen_update_showing_desktop_hint (screen); meta_screen_update_showing_desktop_hint (screen);
} }
@ -2685,7 +2685,7 @@ remove_sequence (MetaScreen *screen,
meta_topic (META_DEBUG_STARTUP, meta_topic (META_DEBUG_STARTUP,
"Removing sequence %s\n", "Removing sequence %s\n",
sn_startup_sequence_get_id (sequence)); sn_startup_sequence_get_id (sequence));
screen->startup_sequences = g_slist_remove (screen->startup_sequences, screen->startup_sequences = g_slist_remove (screen->startup_sequences,
sequence); sequence);
@ -2722,7 +2722,7 @@ collect_timed_out_foreach (void *element,
SnStartupSequence *sequence = element; SnStartupSequence *sequence = element;
long tv_sec, tv_usec; long tv_sec, tv_usec;
double elapsed; double elapsed;
sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec); sn_startup_sequence_get_last_active_time (sequence, &tv_sec, &tv_usec);
elapsed = elapsed =
@ -2733,7 +2733,7 @@ collect_timed_out_foreach (void *element,
"Sequence used %g seconds vs. %g max: %s\n", "Sequence used %g seconds vs. %g max: %s\n",
elapsed, (double) STARTUP_TIMEOUT, elapsed, (double) STARTUP_TIMEOUT,
sn_startup_sequence_get_id (sequence)); sn_startup_sequence_get_id (sequence));
if (elapsed > STARTUP_TIMEOUT) if (elapsed > STARTUP_TIMEOUT)
ctod->list = g_slist_prepend (ctod->list, sequence); ctod->list = g_slist_prepend (ctod->list, sequence);
} }
@ -2744,7 +2744,7 @@ startup_sequence_timeout (void *data)
MetaScreen *screen = data; MetaScreen *screen = data;
CollectTimedOutData ctod; CollectTimedOutData ctod;
GSList *tmp; GSList *tmp;
ctod.list = NULL; ctod.list = NULL;
g_get_current_time (&ctod.now); g_get_current_time (&ctod.now);
g_slist_foreach (screen->startup_sequences, g_slist_foreach (screen->startup_sequences,
@ -2759,14 +2759,14 @@ startup_sequence_timeout (void *data)
meta_topic (META_DEBUG_STARTUP, meta_topic (META_DEBUG_STARTUP,
"Timed out sequence %s\n", "Timed out sequence %s\n",
sn_startup_sequence_get_id (sequence)); sn_startup_sequence_get_id (sequence));
sn_startup_sequence_complete (sequence); sn_startup_sequence_complete (sequence);
tmp = tmp->next; tmp = tmp->next;
} }
g_slist_free (ctod.list); g_slist_free (ctod.list);
if (screen->startup_sequences != NULL) if (screen->startup_sequences != NULL)
{ {
return TRUE; return TRUE;
@ -2785,7 +2785,7 @@ meta_screen_sn_event (SnMonitorEvent *event,
{ {
MetaScreen *screen; MetaScreen *screen;
SnStartupSequence *sequence; SnStartupSequence *sequence;
screen = user_data; screen = user_data;
sequence = sn_monitor_event_get_startup_sequence (event); sequence = sn_monitor_event_get_startup_sequence (event);
@ -2799,7 +2799,7 @@ meta_screen_sn_event (SnMonitorEvent *event,
const char *wmclass; const char *wmclass;
wmclass = sn_startup_sequence_get_wmclass (sequence); wmclass = sn_startup_sequence_get_wmclass (sequence);
meta_topic (META_DEBUG_STARTUP, meta_topic (META_DEBUG_STARTUP,
"Received startup initiated for %s wmclass %s\n", "Received startup initiated for %s wmclass %s\n",
sn_startup_sequence_get_id (sequence), sn_startup_sequence_get_id (sequence),
@ -2865,7 +2865,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
const char *startup_id; const char *startup_id;
GSList *tmp; GSList *tmp;
SnStartupSequence *sequence; SnStartupSequence *sequence;
/* Does the window have a startup ID stored? */ /* Does the window have a startup ID stored? */
startup_id = meta_window_get_startup_id (window); startup_id = meta_window_get_startup_id (window);
@ -2873,7 +2873,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
"Applying startup props to %s id \"%s\"\n", "Applying startup props to %s id \"%s\"\n",
window->desc, window->desc,
startup_id ? startup_id : "(none)"); startup_id ? startup_id : "(none)");
sequence = NULL; sequence = NULL;
if (startup_id == NULL) if (startup_id == NULL)
{ {
@ -2904,11 +2904,11 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
"Ending legacy sequence %s due to window %s\n", "Ending legacy sequence %s due to window %s\n",
sn_startup_sequence_get_id (sequence), sn_startup_sequence_get_id (sequence),
window->desc); window->desc);
sn_startup_sequence_complete (sequence); sn_startup_sequence_complete (sequence);
break; break;
} }
tmp = tmp->next; tmp = tmp->next;
} }
} }
@ -2916,7 +2916,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
/* Still no startup ID? Bail. */ /* Still no startup ID? Bail. */
if (startup_id == NULL) if (startup_id == NULL)
return FALSE; return FALSE;
/* We might get this far and not know the sequence ID (if the window /* We might get this far and not know the sequence ID (if the window
* already had a startup ID stored), so let's look for one if we don't * already had a startup ID stored), so let's look for one if we don't
* already know it. * already know it.
@ -2927,15 +2927,15 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
while (tmp != NULL) while (tmp != NULL)
{ {
const char *id; const char *id;
id = sn_startup_sequence_get_id (tmp->data); id = sn_startup_sequence_get_id (tmp->data);
if (strcmp (id, startup_id) == 0) if (strcmp (id, startup_id) == 0)
{ {
sequence = tmp->data; sequence = tmp->data;
break; break;
} }
tmp = tmp->next; tmp = tmp->next;
} }
} }
@ -2943,7 +2943,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
if (sequence != NULL) if (sequence != NULL)
{ {
gboolean changed_something = FALSE; gboolean changed_something = FALSE;
meta_topic (META_DEBUG_STARTUP, meta_topic (META_DEBUG_STARTUP,
"Found startup sequence for window %s ID \"%s\"\n", "Found startup sequence for window %s ID \"%s\"\n",
window->desc, startup_id); window->desc, startup_id);
@ -2956,7 +2956,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
meta_topic (META_DEBUG_STARTUP, meta_topic (META_DEBUG_STARTUP,
"Setting initial window workspace to %d based on startup info\n", "Setting initial window workspace to %d based on startup info\n",
space); space);
window->initial_workspace_set = TRUE; window->initial_workspace_set = TRUE;
window->initial_workspace = space; window->initial_workspace = space;
changed_something = TRUE; changed_something = TRUE;
@ -2969,7 +2969,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
meta_topic (META_DEBUG_STARTUP, meta_topic (META_DEBUG_STARTUP,
"Setting initial window timestamp to %u based on startup info\n", "Setting initial window timestamp to %u based on startup info\n",
timestamp); timestamp);
window->initial_timestamp_set = TRUE; window->initial_timestamp_set = TRUE;
window->initial_timestamp = timestamp; window->initial_timestamp = timestamp;
changed_something = TRUE; changed_something = TRUE;
@ -2983,7 +2983,7 @@ meta_screen_apply_startup_properties (MetaScreen *screen,
"Did not find startup sequence for window %s ID \"%s\"\n", "Did not find startup sequence for window %s ID \"%s\"\n",
window->desc, startup_id); window->desc, startup_id);
} }
#endif /* HAVE_STARTUP_NOTIFICATION */ #endif /* HAVE_STARTUP_NOTIFICATION */
return FALSE; return FALSE;
@ -2998,10 +2998,10 @@ meta_screen_get_screen_number (MetaScreen *screen)
/** /**
* meta_screen_get_display: * meta_screen_get_display:
* @screen: A #MetaScreen * @screen: A #MetaScreen
* *
* Retrieve the display associated with screen. * Retrieve the display associated with screen.
* *
* Returns: (transfer none): Display * Returns: (transfer none): Display
*/ */
MetaDisplay * MetaDisplay *
meta_screen_get_display (MetaScreen *screen) meta_screen_get_display (MetaScreen *screen)
@ -3028,7 +3028,7 @@ meta_screen_get_xroot (MetaScreen *screen)
* *
* Retrieve the size of the screen. * Retrieve the size of the screen.
*/ */
void void
meta_screen_get_size (MetaScreen *screen, meta_screen_get_size (MetaScreen *screen,
int *width, int *width,
int *height) int *height)
@ -3052,7 +3052,7 @@ meta_screen_set_cm_selection (MetaScreen *screen)
g_snprintf (selection, sizeof(selection), "_NET_WM_CM_S%d", screen->number); g_snprintf (selection, sizeof(selection), "_NET_WM_CM_S%d", screen->number);
meta_verbose ("Setting selection: %s\n", selection); meta_verbose ("Setting selection: %s\n", selection);
a = XInternAtom (screen->display->xdisplay, selection, FALSE); a = XInternAtom (screen->display->xdisplay, selection, FALSE);
XSetSelectionOwner (screen->display->xdisplay, a, XSetSelectionOwner (screen->display->xdisplay, a,
screen->wm_cm_selection_window, screen->wm_cm_timestamp); screen->wm_cm_selection_window, screen->wm_cm_timestamp);
} }
@ -3141,11 +3141,11 @@ meta_screen_set_active_workspace_hint (MetaScreen *screen)
*/ */
if (screen->closing > 0) if (screen->closing > 0)
return; return;
data[0] = meta_workspace_index (screen->active_workspace); data[0] = meta_workspace_index (screen->active_workspace);
meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu\n", data[0]); meta_verbose ("Setting _NET_CURRENT_DESKTOP to %lu\n", data[0]);
meta_error_trap_push (screen->display); meta_error_trap_push (screen->display);
XChangeProperty (screen->display->xdisplay, screen->xroot, XChangeProperty (screen->display->xdisplay, screen->xroot,
screen->display->atom__NET_CURRENT_DESKTOP, screen->display->atom__NET_CURRENT_DESKTOP,

View File

@ -921,7 +921,7 @@ resync_verified_stack_with_xserver_stack (MetaStackTracker *tracker)
MetaStackWindow new; MetaStackWindow new;
MetaStackWindow *expected; MetaStackWindow *expected;
int expected_index; int expected_index;
/* If the current window corresponds to a window that's not /* If the current window corresponds to a window that's not
* in xserver_stack any more then the least disruptive thing * in xserver_stack any more then the least disruptive thing
* we can do is to simply remove it and take another look at * we can do is to simply remove it and take another look at

View File

@ -5,12 +5,12 @@
* @short_description: Which windows cover which other windows * @short_description: Which windows cover which other windows
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002, 2003 Red Hat, Inc. * Copyright (C) 2002, 2003 Red Hat, Inc.
* Copyright (C) 2004 Rob Adams * Copyright (C) 2004 Rob Adams
* Copyright (C) 2004, 2005 Elijah Newren * Copyright (C) 2004, 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -20,7 +20,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -67,7 +67,7 @@ MetaStack*
meta_stack_new (MetaScreen *screen) meta_stack_new (MetaScreen *screen)
{ {
MetaStack *stack; MetaStack *stack;
stack = g_new (MetaStack, 1); stack = g_new (MetaStack, 1);
stack->screen = screen; stack->screen = screen;
@ -85,7 +85,7 @@ meta_stack_new (MetaScreen *screen)
stack->need_resort = FALSE; stack->need_resort = FALSE;
stack->need_relayer = FALSE; stack->need_relayer = FALSE;
stack->need_constrain = FALSE; stack->need_constrain = FALSE;
return stack; return stack;
} }
@ -107,7 +107,7 @@ meta_stack_free (MetaStack *stack)
if (stack->last_all_root_children_stacked) if (stack->last_all_root_children_stacked)
free_last_all_root_children_stacked_cache (stack); free_last_all_root_children_stacked_cache (stack);
g_free (stack); g_free (stack);
} }
@ -119,7 +119,7 @@ meta_stack_add (MetaStack *stack,
if (window->stack_position >= 0) if (window->stack_position >= 0)
meta_bug ("Window %s had stack position already\n", window->desc); meta_bug ("Window %s had stack position already\n", window->desc);
stack->added = g_list_prepend (stack->added, window); stack->added = g_list_prepend (stack->added, window);
window->stack_position = stack->n_positions; window->stack_position = stack->n_positions;
@ -127,7 +127,7 @@ meta_stack_add (MetaStack *stack,
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,
"Window %s has stack_position initialized to %d\n", "Window %s has stack_position initialized to %d\n",
window->desc, window->stack_position); window->desc, window->stack_position);
stack_sync_to_xserver (stack); stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace); meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
} }
@ -148,7 +148,7 @@ meta_stack_remove (MetaStack *stack,
meta_window_set_stack_position_no_sync (window, meta_window_set_stack_position_no_sync (window,
stack->n_positions - 1); stack->n_positions - 1);
window->stack_position = -1; window->stack_position = -1;
stack->n_positions -= 1; stack->n_positions -= 1;
/* We don't know if it's been moved from "added" to "stack" yet */ /* We don't know if it's been moved from "added" to "stack" yet */
stack->added = g_list_remove (stack->added, window); stack->added = g_list_remove (stack->added, window);
@ -163,7 +163,7 @@ meta_stack_remove (MetaStack *stack,
if (window->frame) if (window->frame)
stack->removed = g_list_prepend (stack->removed, stack->removed = g_list_prepend (stack->removed,
GUINT_TO_POINTER (window->frame->xwindow)); GUINT_TO_POINTER (window->frame->xwindow));
stack_sync_to_xserver (stack); stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace); meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
} }
@ -173,7 +173,7 @@ meta_stack_update_layer (MetaStack *stack,
MetaWindow *window) MetaWindow *window)
{ {
stack->need_relayer = TRUE; stack->need_relayer = TRUE;
stack_sync_to_xserver (stack); stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace); meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
} }
@ -183,7 +183,7 @@ meta_stack_update_transient (MetaStack *stack,
MetaWindow *window) MetaWindow *window)
{ {
stack->need_constrain = TRUE; stack->need_constrain = TRUE;
stack_sync_to_xserver (stack); stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace); meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
} }
@ -240,7 +240,7 @@ meta_stack_lower (MetaStack *stack,
return; return;
meta_window_set_stack_position_no_sync (window, min_stack_position); meta_window_set_stack_position_no_sync (window, min_stack_position);
stack_sync_to_xserver (stack); stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, window->screen->active_workspace); meta_stack_update_window_tile_matches (stack, window->screen->active_workspace);
} }
@ -255,7 +255,7 @@ void
meta_stack_thaw (MetaStack *stack) meta_stack_thaw (MetaStack *stack)
{ {
g_return_if_fail (stack->freeze_count > 0); g_return_if_fail (stack->freeze_count > 0);
stack->freeze_count -= 1; stack->freeze_count -= 1;
stack_sync_to_xserver (stack); stack_sync_to_xserver (stack);
meta_stack_update_window_tile_matches (stack, NULL); meta_stack_update_window_tile_matches (stack, NULL);
@ -333,7 +333,7 @@ get_standalone_layer (MetaWindow *window)
case META_WINDOW_OVERRIDE_OTHER: case META_WINDOW_OVERRIDE_OTHER:
layer = META_LAYER_OVERRIDE_REDIRECT; layer = META_LAYER_OVERRIDE_REDIRECT;
break; break;
default: default:
meta_window_foreach_transient (window, meta_window_foreach_transient (window,
is_focused_foreach, is_focused_foreach,
&focused_transient); &focused_transient);
@ -369,16 +369,16 @@ get_maximum_layer_in_group (MetaWindow *window)
GSList *tmp; GSList *tmp;
MetaStackLayer max; MetaStackLayer max;
MetaStackLayer layer; MetaStackLayer layer;
max = META_LAYER_DESKTOP; max = META_LAYER_DESKTOP;
group = meta_window_get_group (window); group = meta_window_get_group (window);
if (group != NULL) if (group != NULL)
members = meta_group_list_windows (group); members = meta_group_list_windows (group);
else else
members = NULL; members = NULL;
tmp = members; tmp = members;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -390,12 +390,12 @@ get_maximum_layer_in_group (MetaWindow *window)
if (layer > max) if (layer > max)
max = layer; max = layer;
} }
tmp = tmp->next; tmp = tmp->next;
} }
g_slist_free (members); g_slist_free (members);
return max; return max;
} }
@ -405,7 +405,7 @@ compute_layer (MetaWindow *window)
MetaStackLayer old_layer = window->layer; MetaStackLayer old_layer = window->layer;
window->layer = get_standalone_layer (window); window->layer = get_standalone_layer (window);
/* We can only do promotion-due-to-group for dialogs and other /* We can only do promotion-due-to-group for dialogs and other
* transients, or weird stuff happens like the desktop window and * transients, or weird stuff happens like the desktop window and
* nautilus windows getting in the same layer, or all gnome-terminal * nautilus windows getting in the same layer, or all gnome-terminal
@ -422,11 +422,11 @@ compute_layer (MetaWindow *window)
* and a dialog transient for the normal window; you don't want the dialog * and a dialog transient for the normal window; you don't want the dialog
* above the dock if it wouldn't normally be. * above the dock if it wouldn't normally be.
*/ */
MetaStackLayer group_max; MetaStackLayer group_max;
group_max = get_maximum_layer_in_group (window); group_max = get_maximum_layer_in_group (window);
if (group_max > window->layer) if (group_max > window->layer)
{ {
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,
@ -467,10 +467,10 @@ compare_window_position (void *a,
else else
return 0; /* not reached */ return 0; /* not reached */
} }
/* /*
* Stacking constraints * Stacking constraints
* *
* Assume constraints of the form "AB" meaning "window A must be * Assume constraints of the form "AB" meaning "window A must be
* below window B" * below window B"
* *
@ -487,14 +487,14 @@ compare_window_position (void *a,
* apply BC: ABC * apply BC: ABC
* *
* but apply constraints in the wrong order and it breaks: * but apply constraints in the wrong order and it breaks:
* *
* start: BCA * start: BCA
* apply BC: BCA * apply BC: BCA
* apply AB: CAB * apply AB: CAB
* *
* We make a directed graph of the constraints by linking * We make a directed graph of the constraints by linking
* from "above windows" to "below windows as follows: * from "above windows" to "below windows as follows:
* *
* AB -> BC -> CD * AB -> BC -> CD
* \ * \
* CE * CE
@ -519,7 +519,7 @@ struct Constraint
/* used to create the graph. */ /* used to create the graph. */
GSList *next_nodes; GSList *next_nodes;
/* constraint has been applied, used /* constraint has been applied, used
* to detect cycles. * to detect cycles.
*/ */
@ -547,7 +547,7 @@ add_constraint (Constraint **constraints,
Constraint *c; Constraint *c;
g_assert (above->screen == below->screen); g_assert (above->screen == below->screen);
/* check if constraint is a duplicate */ /* check if constraint is a duplicate */
c = constraints[below->stack_position]; c = constraints[below->stack_position];
while (c != NULL) while (c != NULL)
@ -574,7 +574,7 @@ create_constraints (Constraint **constraints,
GList *windows) GList *windows)
{ {
GList *tmp; GList *tmp;
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -587,7 +587,7 @@ create_constraints (Constraint **constraints,
tmp = tmp->next; tmp = tmp->next;
continue; continue;
} }
if (WINDOW_TRANSIENT_FOR_WHOLE_GROUP (w)) if (WINDOW_TRANSIENT_FOR_WHOLE_GROUP (w))
{ {
GSList *group_windows; GSList *group_windows;
@ -600,9 +600,9 @@ create_constraints (Constraint **constraints,
group_windows = meta_group_list_windows (group); group_windows = meta_group_list_windows (group);
else else
group_windows = NULL; group_windows = NULL;
tmp2 = group_windows; tmp2 = group_windows;
while (tmp2 != NULL) while (tmp2 != NULL)
{ {
MetaWindow *group_window = tmp2->data; MetaWindow *group_window = tmp2->data;
@ -614,7 +614,7 @@ create_constraints (Constraint **constraints,
tmp2 = tmp2->next; tmp2 = tmp2->next;
continue; continue;
} }
#if 0 #if 0
/* old way of doing it */ /* old way of doing it */
if (!(meta_window_is_ancestor_of_transient (w, group_window)) && if (!(meta_window_is_ancestor_of_transient (w, group_window)) &&
@ -630,7 +630,7 @@ create_constraints (Constraint **constraints,
w->desc, group_window->desc); w->desc, group_window->desc);
add_constraint (constraints, w, group_window); add_constraint (constraints, w, group_window);
} }
tmp2 = tmp2->next; tmp2 = tmp2->next;
} }
@ -640,7 +640,7 @@ create_constraints (Constraint **constraints,
!w->transient_parent_is_root_window) !w->transient_parent_is_root_window)
{ {
MetaWindow *parent; MetaWindow *parent;
parent = parent =
meta_display_lookup_x_window (w->display, w->xtransient_for); meta_display_lookup_x_window (w->display, w->xtransient_for);
@ -652,7 +652,7 @@ create_constraints (Constraint **constraints,
add_constraint (constraints, w, parent); add_constraint (constraints, w, parent);
} }
} }
tmp = tmp->next; tmp = tmp->next;
} }
} }
@ -671,12 +671,12 @@ graph_constraints (Constraint **constraints,
/* If we have "A below B" and "B below C" then AB -> BC so we /* If we have "A below B" and "B below C" then AB -> BC so we
* add BC to next_nodes in AB. * add BC to next_nodes in AB.
*/ */
c = constraints[i]; c = constraints[i];
while (c != NULL) while (c != NULL)
{ {
Constraint *n; Constraint *n;
g_assert (c->below->stack_position == i); g_assert (c->below->stack_position == i);
/* Constraints where ->above is below are our /* Constraints where ->above is below are our
@ -689,10 +689,10 @@ graph_constraints (Constraint **constraints,
n); n);
/* c is a previous node of n */ /* c is a previous node of n */
n->has_prev = TRUE; n->has_prev = TRUE;
n = n->next; n = n->next;
} }
c = c->next; c = c->next;
} }
@ -710,16 +710,16 @@ free_constraints (Constraint **constraints,
while (i < n_constraints) while (i < n_constraints)
{ {
Constraint *c; Constraint *c;
c = constraints[i]; c = constraints[i];
while (c != NULL) while (c != NULL)
{ {
Constraint *next = c->next; Constraint *next = c->next;
g_slist_free (c->next_nodes); g_slist_free (c->next_nodes);
g_free (c); g_free (c);
c = next; c = next;
} }
@ -730,7 +730,7 @@ free_constraints (Constraint **constraints,
static void static void
ensure_above (MetaWindow *above, ensure_above (MetaWindow *above,
MetaWindow *below) MetaWindow *below)
{ {
if (WINDOW_HAS_TRANSIENT_TYPE(above) && if (WINDOW_HAS_TRANSIENT_TYPE(above) &&
above->layer < below->layer) above->layer < below->layer)
{ {
@ -758,10 +758,10 @@ traverse_constraint (Constraint *c)
if (c->applied) if (c->applied)
return; return;
ensure_above (c->above, c->below); ensure_above (c->above, c->below);
c->applied = TRUE; c->applied = TRUE;
tmp = c->next_nodes; tmp = c->next_nodes;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -785,13 +785,13 @@ apply_constraints (Constraint **constraints,
while (i < n_constraints) while (i < n_constraints)
{ {
Constraint *c; Constraint *c;
c = constraints[i]; c = constraints[i];
while (c != NULL) while (c != NULL)
{ {
if (!c->has_prev) if (!c->has_prev)
heads = g_slist_prepend (heads, c); heads = g_slist_prepend (heads, c);
c = c->next; c = c->next;
} }
@ -805,7 +805,7 @@ apply_constraints (Constraint **constraints,
Constraint *c = tmp->data; Constraint *c = tmp->data;
traverse_constraint (c); traverse_constraint (c);
tmp = tmp->next; tmp = tmp->next;
} }
@ -826,7 +826,7 @@ stack_do_window_deletions (MetaStack *stack)
*/ */
GList *tmp; GList *tmp;
int i; int i;
tmp = stack->removed; tmp = stack->removed;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -840,7 +840,7 @@ stack_do_window_deletions (MetaStack *stack)
while (i > 0) while (i > 0)
{ {
--i; --i;
/* there's no guarantee we'll actually find windows to /* there's no guarantee we'll actually find windows to
* remove, e.g. the same xwindow could have been * remove, e.g. the same xwindow could have been
* added/removed before we ever synced, and we put * added/removed before we ever synced, and we put
@ -877,34 +877,34 @@ stack_do_window_additions (MetaStack *stack)
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,
"Adding %d windows to sorted list\n", "Adding %d windows to sorted list\n",
n_added); n_added);
old_size = stack->xwindows->len; old_size = stack->xwindows->len;
g_array_set_size (stack->xwindows, old_size + n_added); g_array_set_size (stack->xwindows, old_size + n_added);
end = &g_array_index (stack->xwindows, Window, old_size); end = &g_array_index (stack->xwindows, Window, old_size);
/* stack->added has the most recent additions at the /* stack->added has the most recent additions at the
* front of the list, so we need to reverse it * front of the list, so we need to reverse it
*/ */
stack->added = g_list_reverse (stack->added); stack->added = g_list_reverse (stack->added);
i = 0; i = 0;
tmp = stack->added; tmp = stack->added;
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *w; MetaWindow *w;
w = tmp->data; w = tmp->data;
end[i] = w->xwindow; end[i] = w->xwindow;
/* add to the main list */ /* add to the main list */
stack->sorted = g_list_prepend (stack->sorted, w); stack->sorted = g_list_prepend (stack->sorted, w);
++i; ++i;
tmp = tmp->next; tmp = tmp->next;
} }
stack->need_resort = TRUE; /* may not be needed as we add to top */ stack->need_resort = TRUE; /* may not be needed as we add to top */
stack->need_constrain = TRUE; stack->need_constrain = TRUE;
stack->need_relayer = TRUE; stack->need_relayer = TRUE;
@ -923,13 +923,13 @@ static void
stack_do_relayer (MetaStack *stack) stack_do_relayer (MetaStack *stack)
{ {
GList *tmp; GList *tmp;
if (!stack->need_relayer) if (!stack->need_relayer)
return; return;
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,
"Recomputing layers\n"); "Recomputing layers\n");
tmp = stack->sorted; tmp = stack->sorted;
while (tmp != NULL) while (tmp != NULL)
@ -954,7 +954,7 @@ stack_do_relayer (MetaStack *stack)
* not layer * not layer
*/ */
} }
tmp = tmp->next; tmp = tmp->next;
} }
@ -973,7 +973,7 @@ stack_do_constrain (MetaStack *stack)
Constraint **constraints; Constraint **constraints;
/* It'd be nice if this were all faster, probably */ /* It'd be nice if this were all faster, probably */
if (!stack->need_constrain) if (!stack->need_constrain)
return; return;
@ -988,10 +988,10 @@ stack_do_constrain (MetaStack *stack)
graph_constraints (constraints, stack->n_positions); graph_constraints (constraints, stack->n_positions);
apply_constraints (constraints, stack->n_positions); apply_constraints (constraints, stack->n_positions);
free_constraints (constraints, stack->n_positions); free_constraints (constraints, stack->n_positions);
g_free (constraints); g_free (constraints);
stack->need_constrain = FALSE; stack->need_constrain = FALSE;
} }
@ -1005,10 +1005,10 @@ stack_do_resort (MetaStack *stack)
{ {
if (!stack->need_resort) if (!stack->need_resort)
return; return;
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,
"Sorting stack list\n"); "Sorting stack list\n");
stack->sorted = g_list_sort (stack->sorted, stack->sorted = g_list_sort (stack->sorted,
(GCompareFunc) compare_window_position); (GCompareFunc) compare_window_position);
@ -1248,12 +1248,12 @@ stack_sync_to_xserver (MetaStack *stack)
GArray *x11_hidden_stack_windows; GArray *x11_hidden_stack_windows;
int n_override_redirect = 0; int n_override_redirect = 0;
MetaStackWindow guard_stack_window; MetaStackWindow guard_stack_window;
/* Bail out if frozen */ /* Bail out if frozen */
if (stack->freeze_count > 0) if (stack->freeze_count > 0)
return; return;
meta_topic (META_DEBUG_STACK, "Syncing window stack to server\n"); meta_topic (META_DEBUG_STACK, "Syncing window stack to server\n");
stack_ensure_sorted (stack); stack_ensure_sorted (stack);
@ -1284,7 +1284,7 @@ stack_sync_to_xserver (MetaStack *stack)
MetaStackWindow stack_window; MetaStackWindow stack_window;
stack_window.any.type = w->client_type; stack_window.any.type = w->client_type;
meta_topic (META_DEBUG_STACK, "%u:%d - %s ", meta_topic (META_DEBUG_STACK, "%u:%d - %s ",
w->layer, w->stack_position, w->desc); w->layer, w->stack_position, w->desc);
@ -1293,7 +1293,7 @@ stack_sync_to_xserver (MetaStack *stack)
n_override_redirect++; n_override_redirect++;
else else
g_array_prepend_val (x11_stacked, w->xwindow); g_array_prepend_val (x11_stacked, w->xwindow);
if (w->frame) if (w->frame)
top_level_window = w->frame->xwindow; top_level_window = w->frame->xwindow;
else else
@ -1336,12 +1336,12 @@ stack_sync_to_xserver (MetaStack *stack)
if (x11_stacked->len != stack->xwindows->len - n_override_redirect) if (x11_stacked->len != stack->xwindows->len - n_override_redirect)
meta_bug ("%u windows stacked, %u windows exist in stack\n", meta_bug ("%u windows stacked, %u windows exist in stack\n",
x11_stacked->len, stack->xwindows->len); x11_stacked->len, stack->xwindows->len);
/* Sync to server */ /* Sync to server */
meta_topic (META_DEBUG_STACK, "Restacking %u windows\n", meta_topic (META_DEBUG_STACK, "Restacking %u windows\n",
all_root_children_stacked->len); all_root_children_stacked->len);
meta_error_trap_push (stack->screen->display); meta_error_trap_push (stack->screen->display);
if (stack->last_all_root_children_stacked == NULL) if (stack->last_all_root_children_stacked == NULL)
@ -1425,7 +1425,7 @@ stack_sync_to_xserver (MetaStack *stack)
/* In this case we have an X window that we need to /* In this case we have an X window that we need to
* put below a wayland window and this is the * put below a wayland window and this is the
* topmost X window. */ * topmost X window. */
/* In X terms (because this is the topmost X window) /* In X terms (because this is the topmost X window)
* we want to * we want to
* raise_window_relative_to_managed_windows() to * raise_window_relative_to_managed_windows() to
@ -1452,7 +1452,7 @@ stack_sync_to_xserver (MetaStack *stack)
* *newp, then we fail to restack *newp; but on * *newp, then we fail to restack *newp; but on
* unmanaging last_xwindow, we'll fix it up. * unmanaging last_xwindow, we'll fix it up.
*/ */
meta_topic (META_DEBUG_STACK, "Placing window 0x%lx below 0x%lx\n", meta_topic (META_DEBUG_STACK, "Placing window 0x%lx below 0x%lx\n",
newp->any.type == META_WINDOW_CLIENT_TYPE_X11 ? newp->x11.xwindow : 0, newp->any.type == META_WINDOW_CLIENT_TYPE_X11 ? newp->x11.xwindow : 0,
last_xwindow); last_xwindow);
@ -1572,7 +1572,7 @@ stack_sync_to_xserver (MetaStack *stack)
* get removed from the stacking list when we unmanage it * get removed from the stacking list when we unmanage it
* and we'll fix stacking at that time. * and we'll fix stacking at that time.
*/ */
/* Sync _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING */ /* Sync _NET_CLIENT_LIST and _NET_CLIENT_LIST_STACKING */
XChangeProperty (stack->screen->display->xdisplay, XChangeProperty (stack->screen->display->xdisplay,
@ -1633,9 +1633,9 @@ meta_stack_get_above (MetaStack *stack,
{ {
GList *link; GList *link;
MetaWindow *above; MetaWindow *above;
stack_ensure_sorted (stack); stack_ensure_sorted (stack);
link = g_list_find (stack->sorted, window); link = g_list_find (stack->sorted, window);
if (link == NULL) if (link == NULL)
return NULL; return NULL;
@ -1658,7 +1658,7 @@ meta_stack_get_below (MetaStack *stack,
{ {
GList *link; GList *link;
MetaWindow *below; MetaWindow *below;
stack_ensure_sorted (stack); stack_ensure_sorted (stack);
link = g_list_find (stack->sorted, window); link = g_list_find (stack->sorted, window);
@ -1667,7 +1667,7 @@ meta_stack_get_below (MetaStack *stack,
return NULL; return NULL;
if (link->next == NULL) if (link->next == NULL)
return NULL; return NULL;
below = link->next->data; below = link->next->data;
if (only_within_layer && if (only_within_layer &&
@ -1801,22 +1801,22 @@ meta_stack_list_windows (MetaStack *stack,
{ {
GList *workspace_windows = NULL; GList *workspace_windows = NULL;
GList *link; GList *link;
stack_ensure_sorted (stack); /* do adds/removes */ stack_ensure_sorted (stack); /* do adds/removes */
link = stack->sorted; link = stack->sorted;
while (link) while (link)
{ {
MetaWindow *window = link->data; MetaWindow *window = link->data;
if (window && if (window &&
(workspace == NULL || meta_window_located_on_workspace (window, workspace))) (workspace == NULL || meta_window_located_on_workspace (window, workspace)))
{ {
workspace_windows = g_list_prepend (workspace_windows, workspace_windows = g_list_prepend (workspace_windows,
window); window);
} }
link = link->next; link = link->next;
} }
@ -1833,7 +1833,7 @@ meta_stack_windows_cmp (MetaStack *stack,
/* -1 means a below b */ /* -1 means a below b */
stack_ensure_sorted (stack); /* update constraints, layers */ stack_ensure_sorted (stack); /* update constraints, layers */
if (window_a->layer < window_b->layer) if (window_a->layer < window_b->layer)
return -1; return -1;
else if (window_a->layer > window_b->layer) else if (window_a->layer > window_b->layer)
@ -1883,7 +1883,7 @@ compare_pointers (gconstpointer a,
return 1; return 1;
else if (a < b) else if (a < b)
return -1; return -1;
else else
return 0; return 0;
} }
@ -1921,7 +1921,7 @@ meta_stack_set_positions (MetaStack *stack,
/* Make sure any adds or removes aren't in limbo -- is this needed? */ /* Make sure any adds or removes aren't in limbo -- is this needed? */
stack_ensure_sorted (stack); stack_ensure_sorted (stack);
if (!lists_contain_same_windows (windows, stack->sorted)) if (!lists_contain_same_windows (windows, stack->sorted))
{ {
meta_warning ("This list of windows has somehow changed; not resetting " meta_warning ("This list of windows has somehow changed; not resetting "
@ -1934,7 +1934,7 @@ meta_stack_set_positions (MetaStack *stack,
stack->need_resort = TRUE; stack->need_resort = TRUE;
stack->need_constrain = TRUE; stack->need_constrain = TRUE;
i = 0; i = 0;
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
@ -1943,7 +1943,7 @@ meta_stack_set_positions (MetaStack *stack,
w->stack_position = i++; w->stack_position = i++;
tmp = tmp->next; tmp = tmp->next;
} }
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,
"Reset the stack positions of (nearly) all windows\n"); "Reset the stack positions of (nearly) all windows\n");
@ -1957,7 +1957,7 @@ meta_window_set_stack_position_no_sync (MetaWindow *window,
{ {
int low, high, delta; int low, high, delta;
GList *tmp; GList *tmp;
g_return_if_fail (window->screen->stack != NULL); g_return_if_fail (window->screen->stack != NULL);
g_return_if_fail (window->stack_position >= 0); g_return_if_fail (window->stack_position >= 0);
g_return_if_fail (position >= 0); g_return_if_fail (position >= 0);
@ -1972,7 +1972,7 @@ meta_window_set_stack_position_no_sync (MetaWindow *window,
window->screen->stack->need_resort = TRUE; window->screen->stack->need_resort = TRUE;
window->screen->stack->need_constrain = TRUE; window->screen->stack->need_constrain = TRUE;
if (position < window->stack_position) if (position < window->stack_position)
{ {
low = position; low = position;
@ -1997,7 +1997,7 @@ meta_window_set_stack_position_no_sync (MetaWindow *window,
tmp = tmp->next; tmp = tmp->next;
} }
window->stack_position = position; window->stack_position = position;
meta_topic (META_DEBUG_STACK, meta_topic (META_DEBUG_STACK,

View File

@ -1,9 +1,9 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -13,7 +13,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -26,7 +26,7 @@
* @short_description: Which windows cover which other windows * @short_description: Which windows cover which other windows
* *
* There are two factors that determine window position. * There are two factors that determine window position.
* *
* One is window->stack_position, which is a unique integer * One is window->stack_position, which is a unique integer
* indicating how windows are ordered with respect to one * indicating how windows are ordered with respect to one
* another. The ordering here transcends layers; it isn't changed * another. The ordering here transcends layers; it isn't changed
@ -34,7 +34,7 @@
* windows from one layer to another, while preserving the relative * windows from one layer to another, while preserving the relative
* order of the moved windows. Also, it allows us to restore * order of the moved windows. Also, it allows us to restore
* the stacking order from a saved session. * the stacking order from a saved session.
* *
* However when actually stacking windows on the screen, the * However when actually stacking windows on the screen, the
* layer overrides the stack_position; windows are first sorted * layer overrides the stack_position; windows are first sorted
* by layer, then by stack_position within each layer. * by layer, then by stack_position within each layer.
@ -82,7 +82,7 @@ struct _MetaStack
* The order of the elements in this list is not important. * The order of the elements in this list is not important.
*/ */
GList *removed; GList *removed;
/** /**
* If this is zero, the local stack oughtn't to be brought up to date with * If this is zero, the local stack oughtn't to be brought up to date with
* the X server's stack, because it is in the middle of being updated. * the X server's stack, because it is in the middle of being updated.

View File

@ -2,9 +2,9 @@
/* Mutter box operation testing program */ /* Mutter box operation testing program */
/* /*
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -363,7 +363,7 @@ test_merge_regions ()
* uniformly distributed location of center of struts (within screen) * uniformly distributed location of center of struts (within screen)
* merge all regions that are possible * merge all regions that are possible
* print stats on problem setup * print stats on problem setup
* number of (non-completely-occluded?) struts * number of (non-completely-occluded?) struts
* percentage of screen covered * percentage of screen covered
* length of resulting non-minimal spanning set * length of resulting non-minimal spanning set
* length of resulting minimal spanning set * length of resulting minimal spanning set
@ -508,11 +508,11 @@ test_merge_regions ()
compare = compare->next; compare = compare->next;
} }
printf (" Num rectangles contained in others : %d\n", printf (" Num rectangles contained in others : %d\n",
num_contains); num_contains);
printf (" Num rectangles partially contained in others: %d\n", printf (" Num rectangles partially contained in others: %d\n",
num_part_contains); num_part_contains);
printf (" Num rectangles adjacent to others : %d\n", printf (" Num rectangles adjacent to others : %d\n",
num_adjacent); num_adjacent);
printf (" Num rectangles merged with others : %d\n", printf (" Num rectangles merged with others : %d\n",
num_merged); num_merged);
@ -583,9 +583,9 @@ test_regions_okay ()
GList* region; GList* region;
GList* tmp; GList* tmp;
/*************************************************************/ /*************************************************************/
/* Make sure test region 0 has the right spanning rectangles */ /* Make sure test region 0 has the right spanning rectangles */
/*************************************************************/ /*************************************************************/
region = get_screen_region (0); region = get_screen_region (0);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_meta_rect (0, 0, 1600, 1200)); tmp = g_list_prepend (tmp, new_meta_rect (0, 0, 1600, 1200));
@ -593,9 +593,9 @@ test_regions_okay ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (region); meta_rectangle_free_list_and_elements (region);
/*************************************************************/ /*************************************************************/
/* Make sure test region 1 has the right spanning rectangles */ /* Make sure test region 1 has the right spanning rectangles */
/*************************************************************/ /*************************************************************/
region = get_screen_region (1); region = get_screen_region (1);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 400, 1180)); tmp = g_list_prepend (tmp, new_meta_rect (0, 20, 400, 1180));
@ -606,7 +606,7 @@ test_regions_okay ()
/*************************************************************/ /*************************************************************/
/* Make sure test region 2 has the right spanning rectangles */ /* Make sure test region 2 has the right spanning rectangles */
/*************************************************************/ /*************************************************************/
region = get_screen_region (2); region = get_screen_region (2);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 300, 1180)); tmp = g_list_prepend (tmp, new_meta_rect ( 0, 20, 300, 1180));
@ -620,7 +620,7 @@ test_regions_okay ()
/*************************************************************/ /*************************************************************/
/* Make sure test region 3 has the right spanning rectangles */ /* Make sure test region 3 has the right spanning rectangles */
/*************************************************************/ /*************************************************************/
region = get_screen_region (3); region = get_screen_region (3);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_meta_rect ( 380, 675, 420, 525)); /* 220500 */ tmp = g_list_prepend (tmp, new_meta_rect ( 380, 675, 420, 525)); /* 220500 */
@ -646,7 +646,7 @@ test_regions_okay ()
/*************************************************************/ /*************************************************************/
/* Make sure test region 4 has the right spanning rectangles */ /* Make sure test region 4 has the right spanning rectangles */
/*************************************************************/ /*************************************************************/
region = get_screen_region (4); region = get_screen_region (4);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_meta_rect ( 800, 20, 800, 1180)); tmp = g_list_prepend (tmp, new_meta_rect ( 800, 20, 800, 1180));
@ -656,7 +656,7 @@ test_regions_okay ()
/*************************************************************/ /*************************************************************/
/* Make sure test region 5 has the right spanning rectangles */ /* Make sure test region 5 has the right spanning rectangles */
/*************************************************************/ /*************************************************************/
printf ("The next test intentionally causes a warning, " printf ("The next test intentionally causes a warning, "
"but it can be ignored.\n"); "but it can be ignored.\n");
region = get_screen_region (5); region = get_screen_region (5);
@ -1020,9 +1020,9 @@ test_find_onscreen_edges ()
int top = META_DIRECTION_TOP; int top = META_DIRECTION_TOP;
int bottom = META_DIRECTION_BOTTOM; int bottom = META_DIRECTION_BOTTOM;
/*************************************************/ /*************************************************/
/* Make sure test region 0 has the correct edges */ /* Make sure test region 0 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (0); edges = get_screen_edges (0);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_screen_edge ( 0, 1200, 1600, 0, bottom)); tmp = g_list_prepend (tmp, new_screen_edge ( 0, 1200, 1600, 0, bottom));
@ -1033,9 +1033,9 @@ test_find_onscreen_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************/ /*************************************************/
/* Make sure test region 1 has the correct edges */ /* Make sure test region 1 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (1); edges = get_screen_edges (1);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_screen_edge ( 0, 1200, 400, 0, bottom)); tmp = g_list_prepend (tmp, new_screen_edge ( 0, 1200, 400, 0, bottom));
@ -1048,9 +1048,9 @@ test_find_onscreen_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************/ /*************************************************/
/* Make sure test region 2 has the correct edges */ /* Make sure test region 2 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (2); edges = get_screen_edges (2);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200, 400, 0, bottom)); tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200, 400, 0, bottom));
@ -1069,9 +1069,9 @@ test_find_onscreen_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************/ /*************************************************/
/* Make sure test region 3 has the correct edges */ /* Make sure test region 3 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (3); edges = get_screen_edges (3);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200, 400, 0, bottom)); tmp = g_list_prepend (tmp, new_screen_edge (1200, 1200, 400, 0, bottom));
@ -1096,7 +1096,7 @@ test_find_onscreen_edges ()
char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE]; char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE];
meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1); meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1);
meta_rectangle_edge_list_to_string (tmp, "\n ", big_buffer2); meta_rectangle_edge_list_to_string (tmp, "\n ", big_buffer2);
printf("Generated edge list:\n %s\nComparison edges list:\n %s\n", printf("Generated edge list:\n %s\nComparison edges list:\n %s\n",
big_buffer1, big_buffer2); big_buffer1, big_buffer2);
#endif #endif
@ -1104,9 +1104,9 @@ test_find_onscreen_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************/ /*************************************************/
/* Make sure test region 4 has the correct edges */ /* Make sure test region 4 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (4); edges = get_screen_edges (4);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1200, 800, 0, bottom)); tmp = g_list_prepend (tmp, new_screen_edge ( 800, 1200, 800, 0, bottom));
@ -1117,18 +1117,18 @@ test_find_onscreen_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************/ /*************************************************/
/* Make sure test region 5 has the correct edges */ /* Make sure test region 5 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (5); edges = get_screen_edges (5);
tmp = NULL; tmp = NULL;
verify_edge_lists_are_equal (edges, tmp); verify_edge_lists_are_equal (edges, tmp);
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************/ /*************************************************/
/* Make sure test region 6 has the correct edges */ /* Make sure test region 6 has the correct edges */
/*************************************************/ /*************************************************/
edges = get_screen_edges (6); edges = get_screen_edges (6);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_screen_edge ( 0, 1200, 1600, 0, bottom)); tmp = g_list_prepend (tmp, new_screen_edge ( 0, 1200, 1600, 0, bottom));
@ -1153,18 +1153,18 @@ test_find_nonintersected_monitor_edges ()
int top = META_DIRECTION_TOP; int top = META_DIRECTION_TOP;
int bottom = META_DIRECTION_BOTTOM; int bottom = META_DIRECTION_BOTTOM;
/*************************************************************************/ /*************************************************************************/
/* Make sure test monitor set 0 for with region 0 has the correct edges */ /* Make sure test monitor set 0 for with region 0 has the correct edges */
/*************************************************************************/ /*************************************************************************/
edges = get_monitor_edges (0, 0); edges = get_monitor_edges (0, 0);
tmp = NULL; tmp = NULL;
verify_edge_lists_are_equal (edges, tmp); verify_edge_lists_are_equal (edges, tmp);
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************************************/ /*************************************************************************/
/* Make sure test monitor set 2 for with region 1 has the correct edges */ /* Make sure test monitor set 2 for with region 1 has the correct edges */
/*************************************************************************/ /*************************************************************************/
edges = get_monitor_edges (2, 1); edges = get_monitor_edges (2, 1);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_monitor_edge ( 0, 600, 1600, 0, bottom)); tmp = g_list_prepend (tmp, new_monitor_edge ( 0, 600, 1600, 0, bottom));
@ -1173,9 +1173,9 @@ test_find_nonintersected_monitor_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************************************/ /*************************************************************************/
/* Make sure test monitor set 1 for with region 2 has the correct edges */ /* Make sure test monitor set 1 for with region 2 has the correct edges */
/*************************************************************************/ /*************************************************************************/
edges = get_monitor_edges (1, 2); edges = get_monitor_edges (1, 2);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 20, 0, 1080, right)); tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 20, 0, 1080, right));
@ -1185,16 +1185,16 @@ test_find_nonintersected_monitor_edges ()
char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE]; char big_buffer1[(EDGE_LENGTH+2)*FUDGE], big_buffer2[(EDGE_LENGTH+2)*FUDGE];
meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1); meta_rectangle_edge_list_to_string (edges, "\n ", big_buffer1);
meta_rectangle_edge_list_to_string (tmp, "\n ", big_buffer2); meta_rectangle_edge_list_to_string (tmp, "\n ", big_buffer2);
printf("Generated edge list:\n %s\nComparison edges list:\n %s\n", printf("Generated edge list:\n %s\nComparison edges list:\n %s\n",
big_buffer1, big_buffer2); big_buffer1, big_buffer2);
#endif #endif
verify_edge_lists_are_equal (edges, tmp); verify_edge_lists_are_equal (edges, tmp);
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************************************/ /*************************************************************************/
/* Make sure test monitor set 3 for with region 3 has the correct edges */ /* Make sure test monitor set 3 for with region 3 has the correct edges */
/*************************************************************************/ /*************************************************************************/
edges = get_monitor_edges (3, 3); edges = get_monitor_edges (3, 3);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_monitor_edge ( 900, 600, 700, 0, bottom)); tmp = g_list_prepend (tmp, new_monitor_edge ( 900, 600, 700, 0, bottom));
@ -1207,9 +1207,9 @@ test_find_nonintersected_monitor_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************************************/ /*************************************************************************/
/* Make sure test monitor set 3 for with region 4 has the correct edges */ /* Make sure test monitor set 3 for with region 4 has the correct edges */
/*************************************************************************/ /*************************************************************************/
edges = get_monitor_edges (3, 4); edges = get_monitor_edges (3, 4);
tmp = NULL; tmp = NULL;
tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 600, 800, 0, bottom)); tmp = g_list_prepend (tmp, new_monitor_edge ( 800, 600, 800, 0, bottom));
@ -1219,9 +1219,9 @@ test_find_nonintersected_monitor_edges ()
meta_rectangle_free_list_and_elements (tmp); meta_rectangle_free_list_and_elements (tmp);
meta_rectangle_free_list_and_elements (edges); meta_rectangle_free_list_and_elements (edges);
/*************************************************************************/ /*************************************************************************/
/* Make sure test monitor set 3 for with region 5has the correct edges */ /* Make sure test monitor set 3 for with region 5has the correct edges */
/*************************************************************************/ /*************************************************************************/
edges = get_monitor_edges (3, 5); edges = get_monitor_edges (3, 5);
tmp = NULL; tmp = NULL;
verify_edge_lists_are_equal (edges, tmp); verify_edge_lists_are_equal (edges, tmp);

View File

@ -2,10 +2,10 @@
/* Mutter utilities */ /* Mutter utilities */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA

View File

@ -1,9 +1,9 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -13,7 +13,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -67,7 +67,7 @@ ensure_logfile (void)
char *tmpl; char *tmpl;
int fd; int fd;
GError *err; GError *err;
tmpl = g_strdup_printf ("mutter-%d-debug-log-XXXXXX", tmpl = g_strdup_printf ("mutter-%d-debug-log-XXXXXX",
(int) getpid ()); (int) getpid ());
@ -77,7 +77,7 @@ ensure_logfile (void)
&err); &err);
g_free (tmpl); g_free (tmpl);
if (err != NULL) if (err != NULL)
{ {
meta_warning ("Failed to open debug log: %s\n", meta_warning ("Failed to open debug log: %s\n",
@ -85,9 +85,9 @@ ensure_logfile (void)
g_error_free (err); g_error_free (err);
return; return;
} }
logfile = fdopen (fd, "w"); logfile = fdopen (fd, "w");
if (logfile == NULL) if (logfile == NULL)
{ {
meta_warning ("Failed to fdopen() log file %s: %s\n", meta_warning ("Failed to fdopen() log file %s: %s\n",
@ -98,7 +98,7 @@ ensure_logfile (void)
{ {
g_printerr ("Opened log file %s\n", filename); g_printerr ("Opened log file %s\n", filename);
} }
g_free (filename); g_free (filename);
} }
} }
@ -116,7 +116,7 @@ meta_set_verbose (gboolean setting)
#ifndef WITH_VERBOSE_MODE #ifndef WITH_VERBOSE_MODE
if (setting) if (setting)
meta_fatal (_("Mutter was compiled without support for verbose mode\n")); meta_fatal (_("Mutter was compiled without support for verbose mode\n"));
#else #else
if (setting) if (setting)
ensure_logfile (); ensure_logfile ();
#endif #endif
@ -225,7 +225,7 @@ utf8_fputs (const char *str,
{ {
char *l; char *l;
int retval; int retval;
l = g_locale_from_utf8 (str, -1, NULL, NULL, NULL); l = g_locale_from_utf8 (str, -1, NULL, NULL, NULL);
if (l == NULL) if (l == NULL)
@ -259,24 +259,24 @@ meta_debug_spew_real (const char *format, ...)
va_list args; va_list args;
gchar *str; gchar *str;
FILE *out; FILE *out;
g_return_if_fail (format != NULL); g_return_if_fail (format != NULL);
if (!is_debugging) if (!is_debugging)
return; return;
va_start (args, format); va_start (args, format);
str = g_strdup_vprintf (format, args); str = g_strdup_vprintf (format, args);
va_end (args); va_end (args);
out = logfile ? logfile : stderr; out = logfile ? logfile : stderr;
if (no_prefix == 0) if (no_prefix == 0)
utf8_fputs ("Window manager: ", out); utf8_fputs ("Window manager: ", out);
utf8_fputs (str, out); utf8_fputs (str, out);
fflush (out); fflush (out);
g_free (str); g_free (str);
} }
#endif /* WITH_VERBOSE_MODE */ #endif /* WITH_VERBOSE_MODE */
@ -381,11 +381,11 @@ meta_topic_real_valist (MetaDebugTopic topic,
++sync_count; ++sync_count;
fprintf (out, "%d: ", sync_count); fprintf (out, "%d: ", sync_count);
} }
utf8_fputs (str, out); utf8_fputs (str, out);
fflush (out); fflush (out);
g_free (str); g_free (str);
} }
@ -410,7 +410,7 @@ meta_bug (const char *format, ...)
FILE *out; FILE *out;
g_return_if_fail (format != NULL); g_return_if_fail (format != NULL);
va_start (args, format); va_start (args, format);
str = g_strdup_vprintf (format, args); str = g_strdup_vprintf (format, args);
va_end (args); va_end (args);
@ -426,9 +426,9 @@ meta_bug (const char *format, ...)
utf8_fputs (str, out); utf8_fputs (str, out);
fflush (out); fflush (out);
g_free (str); g_free (str);
/* stop us in a debugger */ /* stop us in a debugger */
abort (); abort ();
} }
@ -439,9 +439,9 @@ meta_warning (const char *format, ...)
va_list args; va_list args;
gchar *str; gchar *str;
FILE *out; FILE *out;
g_return_if_fail (format != NULL); g_return_if_fail (format != NULL);
va_start (args, format); va_start (args, format);
str = g_strdup_vprintf (format, args); str = g_strdup_vprintf (format, args);
va_end (args); va_end (args);
@ -457,7 +457,7 @@ meta_warning (const char *format, ...)
utf8_fputs (str, out); utf8_fputs (str, out);
fflush (out); fflush (out);
g_free (str); g_free (str);
} }
@ -467,9 +467,9 @@ meta_fatal (const char *format, ...)
va_list args; va_list args;
gchar *str; gchar *str;
FILE *out; FILE *out;
g_return_if_fail (format != NULL); g_return_if_fail (format != NULL);
va_start (args, format); va_start (args, format);
str = g_strdup_vprintf (format, args); str = g_strdup_vprintf (format, args);
va_end (args); va_end (args);
@ -485,7 +485,7 @@ meta_fatal (const char *format, ...)
utf8_fputs (str, out); utf8_fputs (str, out);
fflush (out); fflush (out);
g_free (str); g_free (str);
meta_exit (META_EXIT_ERROR); meta_exit (META_EXIT_ERROR);
@ -508,7 +508,7 @@ meta_pop_no_msg_prefix (void)
void void
meta_exit (MetaExitCode code) meta_exit (MetaExitCode code)
{ {
exit (code); exit (code);
} }

View File

@ -9,12 +9,12 @@
* which the rest of the world is allowed to use.) * which the rest of the world is allowed to use.)
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
* Copyright (C) 2003, 2004 Rob Adams * Copyright (C) 2003, 2004 Rob Adams
* Copyright (C) 2004-2006 Elijah Newren * Copyright (C) 2004-2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -24,7 +24,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -90,7 +90,7 @@ typedef enum
struct _MetaWindow struct _MetaWindow
{ {
GObject parent_instance; GObject parent_instance;
MetaDisplay *display; MetaDisplay *display;
MetaScreen *screen; MetaScreen *screen;
const MetaMonitorInfo *monitor; const MetaMonitorInfo *monitor;
@ -134,18 +134,18 @@ struct _MetaWindow
int hide_titlebar_when_maximized; int hide_titlebar_when_maximized;
int net_wm_pid; int net_wm_pid;
Window xtransient_for; Window xtransient_for;
Window xgroup_leader; Window xgroup_leader;
Window xclient_leader; Window xclient_leader;
MetaWindow *transient_for; MetaWindow *transient_for;
/* Initial workspace property */ /* Initial workspace property */
int initial_workspace; int initial_workspace;
/* Initial timestamp property */ /* Initial timestamp property */
guint32 initial_timestamp; guint32 initial_timestamp;
/* Whether this is an override redirect window or not */ /* Whether this is an override redirect window or not */
guint override_redirect : 1; guint override_redirect : 1;
@ -184,7 +184,7 @@ struct _MetaWindow
* these monitors. If not, this is the single monitor which the window's * these monitors. If not, this is the single monitor which the window's
* origin is on. */ * origin is on. */
gint fullscreen_monitors[4]; gint fullscreen_monitors[4];
/* Whether we're trying to constrain the window to be fully onscreen */ /* Whether we're trying to constrain the window to be fully onscreen */
guint require_fully_onscreen : 1; guint require_fully_onscreen : 1;
@ -213,7 +213,7 @@ struct _MetaWindow
* see also unmaps_pending * see also unmaps_pending
*/ */
guint mapped : 1; guint mapped : 1;
/* Whether window has been hidden from view by lowering it to the bottom /* Whether window has been hidden from view by lowering it to the bottom
* of window stack. * of window stack.
*/ */
@ -247,23 +247,23 @@ struct _MetaWindow
/* whether an initial workspace was explicitly set */ /* whether an initial workspace was explicitly set */
guint initial_workspace_set : 1; guint initial_workspace_set : 1;
/* whether an initial timestamp was explicitly set */ /* whether an initial timestamp was explicitly set */
guint initial_timestamp_set : 1; guint initial_timestamp_set : 1;
/* whether net_wm_user_time has been set yet */ /* whether net_wm_user_time has been set yet */
guint net_wm_user_time_set : 1; guint net_wm_user_time_set : 1;
/* whether net_wm_icon_geometry has been set */ /* whether net_wm_icon_geometry has been set */
guint icon_geometry_set : 1; guint icon_geometry_set : 1;
/* These are the flags from WM_PROTOCOLS */ /* These are the flags from WM_PROTOCOLS */
guint take_focus : 1; guint take_focus : 1;
guint delete_window : 1; guint delete_window : 1;
guint can_ping : 1; guint can_ping : 1;
/* Globally active / No input */ /* Globally active / No input */
guint input : 1; guint input : 1;
/* MWM hints about features of window */ /* MWM hints about features of window */
guint mwm_decorated : 1; guint mwm_decorated : 1;
guint mwm_border_only : 1; guint mwm_border_only : 1;
@ -272,7 +272,7 @@ struct _MetaWindow
guint mwm_has_maximize_func : 1; guint mwm_has_maximize_func : 1;
guint mwm_has_move_func : 1; guint mwm_has_move_func : 1;
guint mwm_has_resize_func : 1; guint mwm_has_resize_func : 1;
/* Computed features of window */ /* Computed features of window */
guint decorated : 1; guint decorated : 1;
guint border_only : 1; guint border_only : 1;
@ -295,7 +295,7 @@ struct _MetaWindow
/* EWHH demands attention flag */ /* EWHH demands attention flag */
guint wm_state_demands_attention : 1; guint wm_state_demands_attention : 1;
/* TRUE iff window == window->display->focus_window */ /* TRUE iff window == window->display->focus_window */
guint has_focus : 1; guint has_focus : 1;
@ -316,15 +316,15 @@ struct _MetaWindow
/* Are we in meta_window_new()? */ /* Are we in meta_window_new()? */
guint constructing : 1; guint constructing : 1;
/* Are we in the various queues? (Bitfield: see META_WINDOW_IS_IN_QUEUE) */ /* Are we in the various queues? (Bitfield: see META_WINDOW_IS_IN_QUEUE) */
guint is_in_queues : NUMBER_OF_QUEUES; guint is_in_queues : NUMBER_OF_QUEUES;
/* Used by keybindings.c */ /* Used by keybindings.c */
guint keys_grabbed : 1; /* normal keybindings grabbed */ guint keys_grabbed : 1; /* normal keybindings grabbed */
guint grab_on_frame : 1; /* grabs are on the frame */ guint grab_on_frame : 1; /* grabs are on the frame */
guint all_keys_grabbed : 1; /* AnyKey grabbed */ guint all_keys_grabbed : 1; /* AnyKey grabbed */
/* Set if the reason for unmanaging the window is that /* Set if the reason for unmanaging the window is that
* it was withdrawn * it was withdrawn
*/ */
@ -337,7 +337,7 @@ struct _MetaWindow
/* Transient parent is a root window */ /* Transient parent is a root window */
guint transient_parent_is_root_window : 1; guint transient_parent_is_root_window : 1;
/* if TRUE, window was maximized at start of current grab op */ /* if TRUE, window was maximized at start of current grab op */
guint shaken_loose : 1; guint shaken_loose : 1;
@ -386,7 +386,7 @@ struct _MetaWindow
guint sync_request_timeout_id; guint sync_request_timeout_id;
/* alarm monitoring client's _NET_WM_SYNC_REQUEST_COUNTER */ /* alarm monitoring client's _NET_WM_SYNC_REQUEST_COUNTER */
XSyncAlarm sync_request_alarm; XSyncAlarm sync_request_alarm;
/* Number of UnmapNotify that are caused by us, if /* Number of UnmapNotify that are caused by us, if
* we get UnmapNotify with none pending then the client * we get UnmapNotify with none pending then the client
* is withdrawing the window. * is withdrawing the window.
@ -402,11 +402,11 @@ struct _MetaWindow
/* window that gets updated net_wm_user_time values */ /* window that gets updated net_wm_user_time values */
Window user_time_window; Window user_time_window;
/* The size we set the window to last (i.e. what we believe /* The size we set the window to last (i.e. what we believe
* to be its actual size on the server). The x, y are * to be its actual size on the server). The x, y are
* the actual server-side x,y so are relative to the frame * the actual server-side x,y so are relative to the frame
* (meaning that they just hold the frame width and height) * (meaning that they just hold the frame width and height)
* or the root window (meaning they specify the location * or the root window (meaning they specify the location
* of the top left of the inner window) as appropriate. * of the top left of the inner window) as appropriate.
*/ */
@ -432,7 +432,7 @@ struct _MetaWindow
* Position always in root coords, unlike window->rect. * Position always in root coords, unlike window->rect.
*/ */
MetaRectangle user_rect; MetaRectangle user_rect;
/* Cached net_wm_icon_geometry */ /* Cached net_wm_icon_geometry */
MetaRectangle icon_geometry; MetaRectangle icon_geometry;
@ -444,7 +444,7 @@ struct _MetaWindow
/* Managed by stack.c */ /* Managed by stack.c */
MetaStackLayer layer; MetaStackLayer layer;
int stack_position; /* see comment in stack.h */ int stack_position; /* see comment in stack.h */
/* Current dialog open for this window */ /* Current dialog open for this window */
int dialog_pid; int dialog_pid;

View File

@ -10,10 +10,10 @@
* are unmapped. * are unmapped.
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2004, 2005 Elijah Newren * Copyright (C) 2004, 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -23,7 +23,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -38,7 +38,7 @@ struct _MetaWorkspace
{ {
GObject parent_instance; GObject parent_instance;
MetaScreen *screen; MetaScreen *screen;
GList *windows; GList *windows;
/* The "MRU list", or "most recently used" list, is a list of /* The "MRU list", or "most recently used" list, is a list of

View File

@ -1,10 +1,10 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* Copyright (C) 2004, 2005 Elijah Newren * Copyright (C) 2004, 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -197,7 +197,7 @@ meta_workspace_new (MetaScreen *screen)
workspace->all_struts = NULL; workspace->all_struts = NULL;
workspace->showing_desktop = FALSE; workspace->showing_desktop = FALSE;
return workspace; return workspace;
} }
@ -219,7 +219,7 @@ workspace_free_all_struts (MetaWorkspace *workspace)
{ {
if (workspace->all_struts == NULL) if (workspace->all_struts == NULL)
return; return;
g_slist_foreach (workspace->all_struts, free_this, NULL); g_slist_foreach (workspace->all_struts, free_this, NULL);
g_slist_free (workspace->all_struts); g_slist_free (workspace->all_struts);
workspace->all_struts = NULL; workspace->all_struts = NULL;
@ -236,7 +236,7 @@ workspace_free_builtin_struts (MetaWorkspace *workspace)
{ {
if (workspace->builtin_struts == NULL) if (workspace->builtin_struts == NULL)
return; return;
g_slist_foreach (workspace->builtin_struts, free_this, NULL); g_slist_foreach (workspace->builtin_struts, free_this, NULL);
g_slist_free (workspace->builtin_struts); g_slist_free (workspace->builtin_struts);
workspace->builtin_struts = NULL; workspace->builtin_struts = NULL;
@ -254,7 +254,7 @@ meta_workspace_remove (MetaWorkspace *workspace)
/* Here we assume all the windows are already on another workspace /* Here we assume all the windows are already on another workspace
* as well, so they won't be "orphaned" * as well, so they won't be "orphaned"
*/ */
tmp = workspace->windows; tmp = workspace->windows;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -272,10 +272,10 @@ meta_workspace_remove (MetaWorkspace *workspace)
g_assert (workspace->windows == NULL); g_assert (workspace->windows == NULL);
screen = workspace->screen; screen = workspace->screen;
workspace->screen->workspaces = workspace->screen->workspaces =
g_list_remove (workspace->screen->workspaces, workspace); g_list_remove (workspace->screen->workspaces, workspace);
g_free (workspace->work_area_monitor); g_free (workspace->work_area_monitor);
g_list_free (workspace->mru_list); g_list_free (workspace->mru_list);
@ -313,11 +313,11 @@ meta_workspace_add_window (MetaWorkspace *workspace,
MetaWindow *window) MetaWindow *window)
{ {
g_return_if_fail (window->workspace == NULL); g_return_if_fail (window->workspace == NULL);
/* If the window is on all workspaces, we want to add it to all mru /* If the window is on all workspaces, we want to add it to all mru
* lists, otherwise just add it to this workspaces mru list * lists, otherwise just add it to this workspaces mru list
*/ */
if (window->on_all_workspaces) if (window->on_all_workspaces)
{ {
if (window->workspace == NULL) if (window->workspace == NULL)
{ {
@ -343,7 +343,7 @@ meta_workspace_add_window (MetaWorkspace *workspace,
window->workspace = workspace; window->workspace = workspace;
meta_window_set_current_workspace_hint (window); meta_window_set_current_workspace_hint (window);
if (window->struts) if (window->struts)
{ {
meta_topic (META_DEBUG_WORKAREA, meta_topic (META_DEBUG_WORKAREA,
@ -371,10 +371,10 @@ meta_workspace_remove_window (MetaWorkspace *workspace,
window->workspace = NULL; window->workspace = NULL;
/* If the window is on all workspaces, we don't want to remove it /* If the window is on all workspaces, we don't want to remove it
* from the MRU list unless this causes it to be removed from all * from the MRU list unless this causes it to be removed from all
* workspaces * workspaces
*/ */
if (window->on_all_workspaces) if (window->on_all_workspaces)
{ {
GList* tmp = window->screen->workspaces; GList* tmp = window->screen->workspaces;
while (tmp) while (tmp)
@ -392,7 +392,7 @@ meta_workspace_remove_window (MetaWorkspace *workspace,
} }
meta_window_set_current_workspace_hint (window); meta_window_set_current_workspace_hint (window);
if (window->struts) if (window->struts)
{ {
meta_topic (META_DEBUG_WORKAREA, meta_topic (META_DEBUG_WORKAREA,
@ -416,12 +416,12 @@ meta_workspace_relocate_windows (MetaWorkspace *workspace,
{ {
GList *tmp; GList *tmp;
GList *copy; GList *copy;
g_return_if_fail (workspace != new_home); g_return_if_fail (workspace != new_home);
/* can't modify list we're iterating over */ /* can't modify list we're iterating over */
copy = g_list_copy (workspace->windows); copy = g_list_copy (workspace->windows);
tmp = copy; tmp = copy;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -429,12 +429,12 @@ meta_workspace_relocate_windows (MetaWorkspace *workspace,
meta_workspace_remove_window (workspace, window); meta_workspace_remove_window (workspace, window);
meta_workspace_add_window (new_home, window); meta_workspace_add_window (new_home, window);
tmp = tmp->next; tmp = tmp->next;
} }
g_list_free (copy); g_list_free (copy);
g_assert (workspace->windows == NULL); g_assert (workspace->windows == NULL);
} }
@ -547,10 +547,10 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
MetaWorkspaceLayout layout1, layout2; MetaWorkspaceLayout layout1, layout2;
gint num_workspaces, current_space, new_space; gint num_workspaces, current_space, new_space;
MetaMotionDirection direction; MetaMotionDirection direction;
meta_verbose ("Activating workspace %d\n", meta_verbose ("Activating workspace %d\n",
meta_workspace_index (workspace)); meta_workspace_index (workspace));
if (workspace->screen->active_workspace == workspace) if (workspace->screen->active_workspace == workspace)
return; return;
@ -582,7 +582,7 @@ meta_workspace_activate_with_focus (MetaWorkspace *workspace,
if (workspace->screen->display->grab_op == META_GRAB_OP_MOVING || if (workspace->screen->display->grab_op == META_GRAB_OP_MOVING ||
workspace->screen->display->grab_op == META_GRAB_OP_KEYBOARD_MOVING) workspace->screen->display->grab_op == META_GRAB_OP_KEYBOARD_MOVING)
move_window = workspace->screen->display->grab_window; move_window = workspace->screen->display->grab_window;
if (move_window != NULL) if (move_window != NULL)
{ {
if (move_window->on_all_workspaces) if (move_window->on_all_workspaces)
@ -739,7 +739,7 @@ meta_workspace_list_windows (MetaWorkspace *workspace)
GSList *display_windows; GSList *display_windows;
GSList *tmp; GSList *tmp;
GList *workspace_windows; GList *workspace_windows;
display_windows = meta_display_list_windows (workspace->screen->display, display_windows = meta_display_list_windows (workspace->screen->display,
META_LIST_DEFAULT); META_LIST_DEFAULT);
@ -767,7 +767,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
GList *tmp; GList *tmp;
GList *windows; GList *windows;
int i; int i;
if (workspace->work_areas_invalid) if (workspace->work_areas_invalid)
{ {
meta_topic (META_DEBUG_WORKAREA, meta_topic (META_DEBUG_WORKAREA,
@ -787,7 +787,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
g_free (workspace->work_area_monitor); g_free (workspace->work_area_monitor);
workspace->work_area_monitor = NULL; workspace->work_area_monitor = NULL;
workspace_free_all_struts (workspace); workspace_free_all_struts (workspace);
for (i = 0; i < workspace->screen->n_monitor_infos; i++) for (i = 0; i < workspace->screen->n_monitor_infos; i++)
@ -800,7 +800,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
workspace->screen_region = NULL; workspace->screen_region = NULL;
workspace->screen_edges = NULL; workspace->screen_edges = NULL;
workspace->monitor_edges = NULL; workspace->monitor_edges = NULL;
workspace->work_areas_invalid = TRUE; workspace->work_areas_invalid = TRUE;
/* redo the size/position constraints on all windows */ /* redo the size/position constraints on all windows */
@ -811,7 +811,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
MetaWindow *w = tmp->data; MetaWindow *w = tmp->data;
meta_window_queue (w, META_QUEUE_MOVE_RESIZE); meta_window_queue (w, META_QUEUE_MOVE_RESIZE);
tmp = tmp->next; tmp = tmp->next;
} }
@ -876,7 +876,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
/* STEP 2: Get the maximal/spanning rects for the onscreen and /* STEP 2: Get the maximal/spanning rects for the onscreen and
* on-single-monitor regions * on-single-monitor regions
*/ */
g_assert (workspace->monitor_region == NULL); g_assert (workspace->monitor_region == NULL);
g_assert (workspace->screen_region == NULL); g_assert (workspace->screen_region == NULL);
@ -948,7 +948,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
workspace->work_area_screen.x, workspace->work_area_screen.x,
workspace->work_area_screen.y, workspace->work_area_screen.y,
workspace->work_area_screen.width, workspace->work_area_screen.width,
workspace->work_area_screen.height); workspace->work_area_screen.height);
/* Now find the work areas for each monitor */ /* Now find the work areas for each monitor */
g_free (workspace->work_area_monitor); g_free (workspace->work_area_monitor);
@ -983,7 +983,7 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
/* STEP 4: Make sure the screen_region is nonempty (separate from step 2 /* STEP 4: Make sure the screen_region is nonempty (separate from step 2
* since it relies on step 3). * since it relies on step 3).
*/ */
if (workspace->screen_region == NULL) if (workspace->screen_region == NULL)
{ {
MetaRectangle *nonempty_region; MetaRectangle *nonempty_region;
@ -1070,7 +1070,7 @@ meta_workspace_get_work_area_for_monitor (MetaWorkspace *workspace,
ensure_work_areas_validated (workspace); ensure_work_areas_validated (workspace);
g_assert (which_monitor < workspace->screen->n_monitor_infos); g_assert (which_monitor < workspace->screen->n_monitor_infos);
*area = workspace->work_area_monitor[which_monitor]; *area = workspace->work_area_monitor[which_monitor];
} }
@ -1086,7 +1086,7 @@ meta_workspace_get_work_area_all_monitors (MetaWorkspace *workspace,
MetaRectangle *area) MetaRectangle *area)
{ {
ensure_work_areas_validated (workspace); ensure_work_areas_validated (workspace);
*area = workspace->work_area_screen; *area = workspace->work_area_screen;
} }
@ -1151,7 +1151,7 @@ MetaWorkspace*
meta_workspace_get_neighbor (MetaWorkspace *workspace, meta_workspace_get_neighbor (MetaWorkspace *workspace,
MetaMotionDirection direction) MetaMotionDirection direction)
{ {
MetaWorkspaceLayout layout; MetaWorkspaceLayout layout;
int i, current_space, num_workspaces; int i, current_space, num_workspaces;
gboolean ltr; gboolean ltr;
@ -1162,10 +1162,10 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
meta_verbose ("Getting neighbor of %d in direction %s\n", meta_verbose ("Getting neighbor of %d in direction %s\n",
current_space, meta_motion_direction_to_string (direction)); current_space, meta_motion_direction_to_string (direction));
ltr = meta_ui_get_direction() == META_UI_DIRECTION_LTR; ltr = meta_ui_get_direction() == META_UI_DIRECTION_LTR;
switch (direction) switch (direction)
{ {
case META_MOTION_LEFT: case META_MOTION_LEFT:
layout.current_col -= ltr ? 1 : -1; layout.current_col -= ltr ? 1 : -1;
@ -1199,12 +1199,12 @@ meta_workspace_get_neighbor (MetaWorkspace *workspace,
if (i >= num_workspaces) if (i >= num_workspaces)
meta_bug ("calc_workspace_layout left an invalid (too-high) workspace number %d in the grid\n", meta_bug ("calc_workspace_layout left an invalid (too-high) workspace number %d in the grid\n",
i); i);
meta_verbose ("Neighbor workspace is %d at row %d col %d\n", meta_verbose ("Neighbor workspace is %d at row %d col %d\n",
i, layout.current_row, layout.current_col); i, layout.current_row, layout.current_col);
meta_screen_free_workspace_layout (&layout); meta_screen_free_workspace_layout (&layout);
return meta_screen_get_workspace_by_index (workspace->screen, i); return meta_screen_get_workspace_by_index (workspace->screen, i);
} }
@ -1258,7 +1258,7 @@ meta_workspace_focus_default_window (MetaWorkspace *workspace,
} }
if (workspace->screen->display->autoraise_window != window && if (workspace->screen->display->autoraise_window != window &&
meta_prefs_get_auto_raise ()) meta_prefs_get_auto_raise ())
{ {
meta_display_queue_autoraise_callback (workspace->screen->display, meta_display_queue_autoraise_callback (workspace->screen->display,
window); window);
@ -1303,7 +1303,7 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Focusing MRU window\n"); "Focusing MRU window\n");
/* First, check to see if we need to focus an ancestor of a window */ /* First, check to see if we need to focus an ancestor of a window */
if (not_this_one) if (not_this_one)
{ {
MetaWindow *ancestor; MetaWindow *ancestor;
@ -1314,9 +1314,9 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
meta_window_showing_on_its_workspace (ancestor)) meta_window_showing_on_its_workspace (ancestor))
{ {
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Focusing %s, ancestor of %s\n", "Focusing %s, ancestor of %s\n",
ancestor->desc, not_this_one->desc); ancestor->desc, not_this_one->desc);
meta_window_focus (ancestor, timestamp); meta_window_focus (ancestor, timestamp);
/* Also raise the window if in click-to-focus */ /* Also raise the window if in click-to-focus */
@ -1335,7 +1335,7 @@ focus_ancestor_or_top_window (MetaWorkspace *workspace,
{ {
meta_topic (META_DEBUG_FOCUS, meta_topic (META_DEBUG_FOCUS,
"Focusing workspace MRU window %s\n", window->desc); "Focusing workspace MRU window %s\n", window->desc);
meta_window_focus (window, timestamp); meta_window_focus (window, timestamp);
/* Also raise the window if in click-to-focus */ /* Also raise the window if in click-to-focus */

View File

@ -2,9 +2,9 @@
/* Simple box operations */ /* Simple box operations */
/* /*
* Copyright (C) 2005, 2006 Elijah Newren * Copyright (C) 2005, 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -4,10 +4,10 @@
* PLEASE KEEP IN SYNC WITH GSETTINGS SCHEMAS! * PLEASE KEEP IN SYNC WITH GSETTINGS SCHEMAS!
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -17,7 +17,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -290,7 +290,7 @@ typedef enum
*/ */
META_VIRTUAL_SHIFT_MASK = 1 << 5, META_VIRTUAL_SHIFT_MASK = 1 << 5,
META_VIRTUAL_CONTROL_MASK = 1 << 6, META_VIRTUAL_CONTROL_MASK = 1 << 6,
META_VIRTUAL_ALT_MASK = 1 << 7, META_VIRTUAL_ALT_MASK = 1 << 7,
META_VIRTUAL_META_MASK = 1 << 8, META_VIRTUAL_META_MASK = 1 << 8,
META_VIRTUAL_SUPER_MASK = 1 << 9, META_VIRTUAL_SUPER_MASK = 1 << 9,
META_VIRTUAL_HYPER_MASK = 1 << 10, META_VIRTUAL_HYPER_MASK = 1 << 10,

View File

@ -2,9 +2,9 @@
/* Mutter X error handling */ /* Mutter X error handling */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,10 +2,10 @@
/* Mutter gradient rendering */ /* Mutter gradient rendering */
/* /*
* Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in * Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in
* WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima * WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. */ * along with this program; if not, see <http://www.gnu.org/licenses/>. */

View File

@ -2,9 +2,9 @@
/* Mutter window groups */ /* Mutter window groups */
/* /*
* Copyright (C) 2002 Red Hat Inc. * Copyright (C) 2002 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,9 +2,9 @@
/* Mutter main */ /* Mutter main */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,10 +2,10 @@
/* Mutter preferences */ /* Mutter preferences */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2006 Elijah Newren * Copyright (C) 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -171,95 +171,95 @@ void meta_prefs_set_ignore_request_hide_titlebar (gboolean whether);
/** /**
* MetaKeyBindingAction: * MetaKeyBindingAction:
* @META_KEYBINDING_ACTION_NONE: FILLME * @META_KEYBINDING_ACTION_NONE: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_1: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_1: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_2: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_2: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_3: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_3: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_4: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_4: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_5: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_5: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_6: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_6: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_7: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_7: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_8: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_8: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_9: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_9: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_10: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_10: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_11: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_11: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_12: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_12: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_LEFT: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_LEFT: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_RIGHT: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_RIGHT: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_UP: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_UP: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_DOWN: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_DOWN: FILLME
* @META_KEYBINDING_ACTION_WORKSPACE_LAST: FILLME * @META_KEYBINDING_ACTION_WORKSPACE_LAST: FILLME
* @META_KEYBINDING_ACTION_SWITCH_APPLICATIONS: FILLME * @META_KEYBINDING_ACTION_SWITCH_APPLICATIONS: FILLME
* @META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD: FILLME * @META_KEYBINDING_ACTION_SWITCH_APPLICATIONS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_SWITCH_GROUP: FILLME * @META_KEYBINDING_ACTION_SWITCH_GROUP: FILLME
* @META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD: FILLME * @META_KEYBINDING_ACTION_SWITCH_GROUP_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_SWITCH_WINDOWS: FILLME * @META_KEYBINDING_ACTION_SWITCH_WINDOWS: FILLME
* @META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD: FILLME * @META_KEYBINDING_ACTION_SWITCH_WINDOWS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_SWITCH_PANELS: FILLME * @META_KEYBINDING_ACTION_SWITCH_PANELS: FILLME
* @META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD: FILLME * @META_KEYBINDING_ACTION_SWITCH_PANELS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_CYCLE_GROUP: FILLME * @META_KEYBINDING_ACTION_CYCLE_GROUP: FILLME
* @META_KEYBINDING_ACTION_CYCLE_GROUP_BACKWARD: FILLME * @META_KEYBINDING_ACTION_CYCLE_GROUP_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_CYCLE_WINDOWS: FILLME * @META_KEYBINDING_ACTION_CYCLE_WINDOWS: FILLME
* @META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD: FILLME * @META_KEYBINDING_ACTION_CYCLE_WINDOWS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_CYCLE_PANELS: FILLME * @META_KEYBINDING_ACTION_CYCLE_PANELS: FILLME
* @META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD: FILLME * @META_KEYBINDING_ACTION_CYCLE_PANELS_BACKWARD: FILLME
* @META_KEYBINDING_ACTION_SHOW_DESKTOP: FILLME * @META_KEYBINDING_ACTION_SHOW_DESKTOP: FILLME
* @META_KEYBINDING_ACTION_PANEL_MAIN_MENU: FILLME * @META_KEYBINDING_ACTION_PANEL_MAIN_MENU: FILLME
* @META_KEYBINDING_ACTION_PANEL_RUN_DIALOG: FILLME * @META_KEYBINDING_ACTION_PANEL_RUN_DIALOG: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_RECORDING: FILLME * @META_KEYBINDING_ACTION_TOGGLE_RECORDING: FILLME
* @META_KEYBINDING_ACTION_SET_SPEW_MARK: FILLME * @META_KEYBINDING_ACTION_SET_SPEW_MARK: FILLME
* @META_KEYBINDING_ACTION_ACTIVATE_WINDOW_MENU: FILLME * @META_KEYBINDING_ACTION_ACTIVATE_WINDOW_MENU: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_FULLSCREEN: FILLME * @META_KEYBINDING_ACTION_TOGGLE_FULLSCREEN: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_MAXIMIZED: FILLME * @META_KEYBINDING_ACTION_TOGGLE_MAXIMIZED: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_TILED_LEFT: FILLME * @META_KEYBINDING_ACTION_TOGGLE_TILED_LEFT: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_TILED_RIGHT: FILLME * @META_KEYBINDING_ACTION_TOGGLE_TILED_RIGHT: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_ABOVE: FILLME * @META_KEYBINDING_ACTION_TOGGLE_ABOVE: FILLME
* @META_KEYBINDING_ACTION_MAXIMIZE: FILLME * @META_KEYBINDING_ACTION_MAXIMIZE: FILLME
* @META_KEYBINDING_ACTION_UNMAXIMIZE: FILLME * @META_KEYBINDING_ACTION_UNMAXIMIZE: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_SHADED: FILLME * @META_KEYBINDING_ACTION_TOGGLE_SHADED: FILLME
* @META_KEYBINDING_ACTION_MINIMIZE: FILLME * @META_KEYBINDING_ACTION_MINIMIZE: FILLME
* @META_KEYBINDING_ACTION_CLOSE: FILLME * @META_KEYBINDING_ACTION_CLOSE: FILLME
* @META_KEYBINDING_ACTION_BEGIN_MOVE: FILLME * @META_KEYBINDING_ACTION_BEGIN_MOVE: FILLME
* @META_KEYBINDING_ACTION_BEGIN_RESIZE: FILLME * @META_KEYBINDING_ACTION_BEGIN_RESIZE: FILLME
* @META_KEYBINDING_ACTION_TOGGLE_ON_ALL_WORKSPACES: FILLME * @META_KEYBINDING_ACTION_TOGGLE_ON_ALL_WORKSPACES: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_1: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_1: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_2: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_2: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_3: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_3: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_4: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_4: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_5: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_5: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_6: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_6: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_7: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_7: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_8: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_8: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_9: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_9: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_10: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_10: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_11: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_11: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_12: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_12: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_LEFT: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_LEFT: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_RIGHT: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_RIGHT: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_UP: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_UP: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_DOWN: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_LAST: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_WORKSPACE_LAST: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_LEFT: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_RIGHT: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_UP: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_MONITOR_DOWN: FILLME
* @META_KEYBINDING_ACTION_RAISE_OR_LOWER: FILLME * @META_KEYBINDING_ACTION_RAISE_OR_LOWER: FILLME
* @META_KEYBINDING_ACTION_RAISE: FILLME * @META_KEYBINDING_ACTION_RAISE: FILLME
* @META_KEYBINDING_ACTION_LOWER: FILLME * @META_KEYBINDING_ACTION_LOWER: FILLME
* @META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY: FILLME * @META_KEYBINDING_ACTION_MAXIMIZE_VERTICALLY: FILLME
* @META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY: FILLME * @META_KEYBINDING_ACTION_MAXIMIZE_HORIZONTALLY: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NW: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_CORNER_NE: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_SW: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_CORNER_SW: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_CORNER_SE: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_CORNER_SE: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_SIDE_N: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_SIDE_N: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_SIDE_S: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_SIDE_S: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_SIDE_E: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_SIDE_E: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_SIDE_W: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_SIDE_W: FILLME
* @META_KEYBINDING_ACTION_MOVE_TO_CENTER: FILLME * @META_KEYBINDING_ACTION_MOVE_TO_CENTER: FILLME
* @META_KEYBINDING_ACTION_OVERLAY_KEY: FILLME * @META_KEYBINDING_ACTION_OVERLAY_KEY: FILLME
* @META_KEYBINDING_ACTION_ALWAYS_ON_TOP: FILLME * @META_KEYBINDING_ACTION_ALWAYS_ON_TOP: FILLME
* @META_KEYBINDING_ACTION_LAST: FILLME * @META_KEYBINDING_ACTION_LAST: FILLME
*/ */
/* XXX FIXME This should be x-macroed, but isn't yet because it would be /* XXX FIXME This should be x-macroed, but isn't yet because it would be
* difficult (or perhaps impossible) to add the suffixes using the current * difficult (or perhaps impossible) to add the suffixes using the current

View File

@ -2,9 +2,9 @@
/* Metacity Theme Rendering */ /* Metacity Theme Rendering */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,10 +2,10 @@
/* Mutter utilities */ /* Mutter utilities */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -15,7 +15,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,11 +2,11 @@
/* Metacity window frame manager widget */ /* Metacity window frame manager widget */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2003 Red Hat, Inc. * Copyright (C) 2003 Red Hat, Inc.
* Copyright (C) 2005, 2006 Elijah Newren * Copyright (C) 2005, 2006 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -129,7 +129,7 @@ meta_frames_class_init (MetaFramesClass *class)
widget_class->style_updated = meta_frames_style_updated; widget_class->style_updated = meta_frames_style_updated;
widget_class->draw = meta_frames_draw; widget_class->draw = meta_frames_draw;
widget_class->destroy_event = meta_frames_destroy_event; widget_class->destroy_event = meta_frames_destroy_event;
widget_class->button_press_event = meta_frames_button_press_event; widget_class->button_press_event = meta_frames_button_press_event;
widget_class->button_release_event = meta_frames_button_release_event; widget_class->button_release_event = meta_frames_button_release_event;
widget_class->motion_notify_event = meta_frames_motion_notify_event; widget_class->motion_notify_event = meta_frames_motion_notify_event;
@ -217,7 +217,7 @@ static void
meta_frames_init (MetaFrames *frames) meta_frames_init (MetaFrames *frames)
{ {
frames->text_heights = g_hash_table_new (NULL, NULL); frames->text_heights = g_hash_table_new (NULL, NULL);
frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal); frames->frames = g_hash_table_new (unsigned_long_hash, unsigned_long_equal);
frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal, frames->style_variants = g_hash_table_new_full (g_str_hash, g_str_equal,
@ -245,7 +245,7 @@ meta_frames_destroy (GtkWidget *object)
GSList *winlist; GSList *winlist;
GSList *tmp; GSList *tmp;
MetaFrames *frames; MetaFrames *frames;
frames = META_FRAMES (object); frames = META_FRAMES (object);
winlist = NULL; winlist = NULL;
@ -281,13 +281,13 @@ static void
meta_frames_finalize (GObject *object) meta_frames_finalize (GObject *object)
{ {
MetaFrames *frames; MetaFrames *frames;
frames = META_FRAMES (object); frames = META_FRAMES (object);
meta_prefs_remove_listener (prefs_changed_callback, frames); meta_prefs_remove_listener (prefs_changed_callback, frames);
g_hash_table_destroy (frames->text_heights); g_hash_table_destroy (frames->text_heights);
g_assert (g_hash_table_size (frames->frames) == 0); g_assert (g_hash_table_size (frames->frames) == 0);
g_hash_table_destroy (frames->frames); g_hash_table_destroy (frames->frames);
@ -308,7 +308,7 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
* in case of color change. * in case of color change.
*/ */
meta_frames_set_window_background (frames, frame); meta_frames_set_window_background (frames, frame);
invalidate_whole_window (frames, frame); invalidate_whole_window (frames, frame);
meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), meta_core_queue_frame_resize (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
frame->xwindow); frame->xwindow);
@ -316,7 +316,7 @@ queue_recalc_func (gpointer key, gpointer value, gpointer data)
{ {
/* save title to recreate layout */ /* save title to recreate layout */
g_free (frame->title); g_free (frame->title);
frame->title = g_strdup (pango_layout_get_text (frame->layout)); frame->title = g_strdup (pango_layout_get_text (frame->layout));
g_object_unref (G_OBJECT (frame->layout)); g_object_unref (G_OBJECT (frame->layout));
@ -332,7 +332,7 @@ meta_frames_font_changed (MetaFrames *frames)
g_hash_table_destroy (frames->text_heights); g_hash_table_destroy (frames->text_heights);
frames->text_heights = g_hash_table_new (NULL, NULL); frames->text_heights = g_hash_table_new (NULL, NULL);
} }
/* Queue a draw/resize on all frames */ /* Queue a draw/resize on all frames */
g_hash_table_foreach (frames->frames, g_hash_table_foreach (frames->frames,
queue_recalc_func, frames); queue_recalc_func, frames);
@ -405,7 +405,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
widget = GTK_WIDGET (frames); widget = GTK_WIDGET (frames);
g_return_if_fail (gtk_widget_get_realized (widget)); g_return_if_fail (gtk_widget_get_realized (widget));
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow, meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_FRAME_TYPE, &type, META_CORE_GET_FRAME_TYPE, &type,
@ -420,7 +420,7 @@ meta_frames_ensure_layout (MetaFrames *frames,
{ {
/* save title to recreate layout */ /* save title to recreate layout */
g_free (frame->title); g_free (frame->title);
frame->title = g_strdup (pango_layout_get_text (frame->layout)); frame->title = g_strdup (pango_layout_get_text (frame->layout));
g_object_unref (G_OBJECT (frame->layout)); g_object_unref (G_OBJECT (frame->layout));
@ -429,18 +429,18 @@ meta_frames_ensure_layout (MetaFrames *frames,
} }
frame->cache_style = style; frame->cache_style = style;
if (frame->layout == NULL) if (frame->layout == NULL)
{ {
gpointer key, value; gpointer key, value;
PangoFontDescription *font_desc; PangoFontDescription *font_desc;
double scale; double scale;
int size; int size;
scale = meta_theme_get_title_scale (meta_theme_get_current (), scale = meta_theme_get_title_scale (meta_theme_get_current (),
type, type,
flags); flags);
frame->layout = gtk_widget_create_pango_layout (widget, frame->title); frame->layout = gtk_widget_create_pango_layout (widget, frame->title);
pango_layout_set_ellipsize (frame->layout, PANGO_ELLIPSIZE_END); pango_layout_set_ellipsize (frame->layout, PANGO_ELLIPSIZE_END);
@ -468,10 +468,10 @@ meta_frames_ensure_layout (MetaFrames *frames,
GINT_TO_POINTER (size), GINT_TO_POINTER (size),
GINT_TO_POINTER (frame->text_height)); GINT_TO_POINTER (frame->text_height));
} }
pango_layout_set_font_description (frame->layout, pango_layout_set_font_description (frame->layout,
font_desc); font_desc);
pango_font_description_free (font_desc); pango_font_description_free (font_desc);
/* Save some RAM */ /* Save some RAM */
@ -489,7 +489,7 @@ meta_frames_calc_geometry (MetaFrames *frames,
MetaFrameFlags flags; MetaFrameFlags flags;
MetaFrameType type; MetaFrameType type;
MetaButtonLayout button_layout; MetaButtonLayout button_layout;
meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow, meta_core_get (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow,
META_CORE_GET_CLIENT_WIDTH, &width, META_CORE_GET_CLIENT_WIDTH, &width,
META_CORE_GET_CLIENT_HEIGHT, &height, META_CORE_GET_CLIENT_HEIGHT, &height,
@ -500,7 +500,7 @@ meta_frames_calc_geometry (MetaFrames *frames,
meta_frames_ensure_layout (frames, frame); meta_frames_ensure_layout (frames, frame);
meta_prefs_get_button_layout (&button_layout); meta_prefs_get_button_layout (&button_layout);
meta_theme_calc_geometry (meta_theme_get_current (), meta_theme_calc_geometry (meta_theme_get_current (),
type, type,
frame->text_height, frame->text_height,
@ -575,7 +575,7 @@ meta_frames_manage_window (MetaFrames *frames,
g_assert (window); g_assert (window);
frame = g_new (MetaUIFrame, 1); frame = g_new (MetaUIFrame, 1);
frame->window = window; frame->window = window;
gdk_window_set_user_data (frame->window, frames); gdk_window_set_user_data (frame->window, frames);
@ -583,7 +583,7 @@ meta_frames_manage_window (MetaFrames *frames,
frame->style = NULL; frame->style = NULL;
/* Don't set event mask here, it's in frame.c */ /* Don't set event mask here, it's in frame.c */
frame->xwindow = xwindow; frame->xwindow = xwindow;
frame->cache_style = NULL; frame->cache_style = NULL;
frame->layout = NULL; frame->layout = NULL;
@ -596,9 +596,9 @@ meta_frames_manage_window (MetaFrames *frames,
* registered with its MetaWindow, which happens after this function * registered with its MetaWindow, which happens after this function
* and meta_ui_create_frame_window() return to meta_window_ensure_frame(). * and meta_ui_create_frame_window() return to meta_window_ensure_frame().
*/ */
meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow); meta_core_grab_buttons (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), frame->xwindow);
g_hash_table_replace (frames->frames, &frame->xwindow, frame); g_hash_table_replace (frames->frames, &frame->xwindow, frame);
} }
@ -621,7 +621,7 @@ meta_frames_unmanage_window (MetaFrames *frames,
if (frames->last_motion_frame == frame) if (frames->last_motion_frame == frame)
frames->last_motion_frame = NULL; frames->last_motion_frame = NULL;
g_hash_table_remove (frames->frames, &frame->xwindow); g_hash_table_remove (frames->frames, &frame->xwindow);
g_object_unref (frame->style); g_object_unref (frame->style);
@ -633,7 +633,7 @@ meta_frames_unmanage_window (MetaFrames *frames,
if (frame->title) if (frame->title)
g_free (frame->title); g_free (frame->title);
g_free (frame); g_free (frame);
} }
else else
@ -667,7 +667,7 @@ meta_ui_frame_get_borders (MetaFrames *frames,
g_return_if_fail (type < META_FRAME_TYPE_LAST); g_return_if_fail (type < META_FRAME_TYPE_LAST);
meta_frames_ensure_layout (frames, frame); meta_frames_ensure_layout (frames, frame);
/* We can't get the full geometry, because that depends on /* We can't get the full geometry, because that depends on
* the client window size and probably we're being called * the client window size and probably we're being called
* by the core move/resize code to decide on the client * by the core move/resize code to decide on the client
@ -731,7 +731,7 @@ meta_frames_reset_bg (MetaFrames *frames,
Window xwindow) Window xwindow)
{ {
MetaUIFrame *frame; MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow); frame = meta_frames_lookup_window (frames, xwindow);
meta_frames_set_window_background (frames, frame); meta_frames_set_window_background (frames, frame);
@ -755,7 +755,7 @@ meta_frames_unflicker_bg (MetaFrames *frames,
int target_height) int target_height)
{ {
MetaUIFrame *frame; MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow); frame = meta_frames_lookup_window (frames, xwindow);
g_return_if_fail (frame != NULL); g_return_if_fail (frame != NULL);
@ -807,7 +807,7 @@ get_visible_region (MetaFrames *frames,
corners_region = cairo_region_create (); corners_region = cairo_region_create ();
get_visible_frame_rect (fgeom, window_width, window_height, &frame_rect); get_visible_frame_rect (fgeom, window_width, window_height, &frame_rect);
if (fgeom->top_left_corner_rounded_radius != 0) if (fgeom->top_left_corner_rounded_radius != 0)
{ {
const int corner = fgeom->top_left_corner_rounded_radius; const int corner = fgeom->top_left_corner_rounded_radius;
@ -821,7 +821,7 @@ get_visible_region (MetaFrames *frames,
rect.y = frame_rect.y + i; rect.y = frame_rect.y + i;
rect.width = width; rect.width = width;
rect.height = 1; rect.height = 1;
cairo_region_union_rectangle (corners_region, &rect); cairo_region_union_rectangle (corners_region, &rect);
} }
} }
@ -839,7 +839,7 @@ get_visible_region (MetaFrames *frames,
rect.y = frame_rect.y + i; rect.y = frame_rect.y + i;
rect.width = width; rect.width = width;
rect.height = 1; rect.height = 1;
cairo_region_union_rectangle (corners_region, &rect); cairo_region_union_rectangle (corners_region, &rect);
} }
} }
@ -857,7 +857,7 @@ get_visible_region (MetaFrames *frames,
rect.y = frame_rect.y + frame_rect.height - i - 1; rect.y = frame_rect.y + frame_rect.height - i - 1;
rect.width = width; rect.width = width;
rect.height = 1; rect.height = 1;
cairo_region_union_rectangle (corners_region, &rect); cairo_region_union_rectangle (corners_region, &rect);
} }
} }
@ -875,11 +875,11 @@ get_visible_region (MetaFrames *frames,
rect.y = frame_rect.y + frame_rect.height - i - 1; rect.y = frame_rect.y + frame_rect.height - i - 1;
rect.width = width; rect.width = width;
rect.height = 1; rect.height = 1;
cairo_region_union_rectangle (corners_region, &rect); cairo_region_union_rectangle (corners_region, &rect);
} }
} }
visible_region = cairo_region_create_rectangle (&frame_rect); visible_region = cairo_region_create_rectangle (&frame_rect);
cairo_region_subtract (visible_region, corners_region); cairo_region_subtract (visible_region, corners_region);
cairo_region_destroy (corners_region); cairo_region_destroy (corners_region);
@ -916,7 +916,7 @@ meta_frames_move_resize_frame (MetaFrames *frames,
{ {
MetaUIFrame *frame = meta_frames_lookup_window (frames, xwindow); MetaUIFrame *frame = meta_frames_lookup_window (frames, xwindow);
int old_width, old_height; int old_width, old_height;
old_width = gdk_window_get_width (frame->window); old_width = gdk_window_get_width (frame->window);
old_height = gdk_window_get_height (frame->window); old_height = gdk_window_get_height (frame->window);
@ -931,7 +931,7 @@ meta_frames_queue_draw (MetaFrames *frames,
Window xwindow) Window xwindow)
{ {
MetaUIFrame *frame; MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow); frame = meta_frames_lookup_window (frames, xwindow);
invalidate_whole_window (frames, frame); invalidate_whole_window (frames, frame);
@ -943,14 +943,14 @@ meta_frames_set_title (MetaFrames *frames,
const char *title) const char *title)
{ {
MetaUIFrame *frame; MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow); frame = meta_frames_lookup_window (frames, xwindow);
g_assert (frame); g_assert (frame);
g_free (frame->title); g_free (frame->title);
frame->title = g_strdup (title); frame->title = g_strdup (title);
if (frame->layout) if (frame->layout)
{ {
g_object_unref (frame->layout); g_object_unref (frame->layout);
@ -979,7 +979,7 @@ meta_frames_repaint_frame (MetaFrames *frames,
Window xwindow) Window xwindow)
{ {
MetaUIFrame *frame; MetaUIFrame *frame;
frame = meta_frames_lookup_window (frames, xwindow); frame = meta_frames_lookup_window (frames, xwindow);
g_assert (frame); g_assert (frame);
@ -997,7 +997,7 @@ redraw_control (MetaFrames *frames,
{ {
MetaFrameGeometry fgeom; MetaFrameGeometry fgeom;
GdkRectangle *rect; GdkRectangle *rect;
meta_frames_calc_geometry (frames, frame, &fgeom); meta_frames_calc_geometry (frames, frame, &fgeom);
rect = control_rect (control, &fgeom); rect = control_rect (control, &fgeom);
@ -1014,7 +1014,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
Display *display; Display *display;
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
switch (action) switch (action)
{ {
case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_SHADE: case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_SHADE:
@ -1022,7 +1022,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
meta_core_get (display, frame->xwindow, meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_END); META_CORE_GET_END);
if (flags & META_FRAME_ALLOWS_SHADE) if (flags & META_FRAME_ALLOWS_SHADE)
{ {
if (flags & META_FRAME_SHADED) if (flags & META_FRAME_SHADED)
@ -1035,14 +1035,14 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
event->time); event->time);
} }
} }
break; break;
case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE: case G_DESKTOP_TITLEBAR_ACTION_TOGGLE_MAXIMIZE:
{ {
meta_core_get (display, frame->xwindow, meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_END); META_CORE_GET_END);
if (flags & META_FRAME_ALLOWS_MAXIMIZE) if (flags & META_FRAME_ALLOWS_MAXIMIZE)
{ {
meta_core_toggle_maximize (display, frame->xwindow); meta_core_toggle_maximize (display, frame->xwindow);
@ -1055,7 +1055,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
meta_core_get (display, frame->xwindow, meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_END); META_CORE_GET_END);
if (flags & META_FRAME_ALLOWS_MAXIMIZE) if (flags & META_FRAME_ALLOWS_MAXIMIZE)
{ {
meta_core_toggle_maximize_horizontally (display, frame->xwindow); meta_core_toggle_maximize_horizontally (display, frame->xwindow);
@ -1068,7 +1068,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
meta_core_get (display, frame->xwindow, meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_END); META_CORE_GET_END);
if (flags & META_FRAME_ALLOWS_MAXIMIZE) if (flags & META_FRAME_ALLOWS_MAXIMIZE)
{ {
meta_core_toggle_maximize_vertically (display, frame->xwindow); meta_core_toggle_maximize_vertically (display, frame->xwindow);
@ -1081,7 +1081,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
meta_core_get (display, frame->xwindow, meta_core_get (display, frame->xwindow,
META_CORE_GET_FRAME_FLAGS, &flags, META_CORE_GET_FRAME_FLAGS, &flags,
META_CORE_GET_END); META_CORE_GET_END);
if (flags & META_FRAME_ALLOWS_MINIMIZE) if (flags & META_FRAME_ALLOWS_MINIMIZE)
{ {
meta_core_minimize (display, frame->xwindow); meta_core_minimize (display, frame->xwindow);
@ -1092,7 +1092,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
case G_DESKTOP_TITLEBAR_ACTION_NONE: case G_DESKTOP_TITLEBAR_ACTION_NONE:
/* Yaay, a sane user that doesn't use that other weird crap! */ /* Yaay, a sane user that doesn't use that other weird crap! */
break; break;
case G_DESKTOP_TITLEBAR_ACTION_LOWER: case G_DESKTOP_TITLEBAR_ACTION_LOWER:
meta_core_user_lower_and_unfocus (display, meta_core_user_lower_and_unfocus (display,
frame->xwindow, frame->xwindow,
@ -1108,7 +1108,7 @@ meta_frame_titlebar_event (MetaUIFrame *frame,
event->time); event->time);
break; break;
} }
return TRUE; return TRUE;
} }
@ -1117,7 +1117,7 @@ meta_frame_double_click_event (MetaUIFrame *frame,
GdkEventButton *event) GdkEventButton *event)
{ {
int action = meta_prefs_get_action_double_click_titlebar (); int action = meta_prefs_get_action_double_click_titlebar ();
return meta_frame_titlebar_event (frame, event, action); return meta_frame_titlebar_event (frame, event, action);
} }
@ -1126,7 +1126,7 @@ meta_frame_middle_click_event (MetaUIFrame *frame,
GdkEventButton *event) GdkEventButton *event)
{ {
int action = meta_prefs_get_action_middle_click_titlebar(); int action = meta_prefs_get_action_middle_click_titlebar();
return meta_frame_titlebar_event (frame, event, action); return meta_frame_titlebar_event (frame, event, action);
} }
@ -1135,7 +1135,7 @@ meta_frame_right_click_event(MetaUIFrame *frame,
GdkEventButton *event) GdkEventButton *event)
{ {
int action = meta_prefs_get_action_right_click_titlebar(); int action = meta_prefs_get_action_right_click_titlebar();
return meta_frame_titlebar_event (frame, event, action); return meta_frame_titlebar_event (frame, event, action);
} }
@ -1147,14 +1147,14 @@ meta_frames_button_press_event (GtkWidget *widget,
MetaFrames *frames; MetaFrames *frames;
MetaFrameControl control; MetaFrameControl control;
Display *display; Display *display;
frames = META_FRAMES (widget); frames = META_FRAMES (widget);
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
/* Remember that the display may have already done something with this event. /* Remember that the display may have already done something with this event.
* If so there's probably a GrabOp in effect. * If so there's probably a GrabOp in effect.
*/ */
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window)); frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
if (frame == NULL) if (frame == NULL)
return FALSE; return FALSE;
@ -1172,13 +1172,13 @@ meta_frames_button_press_event (GtkWidget *widget,
frame->xwindow); frame->xwindow);
meta_core_user_focus (display, meta_core_user_focus (display,
frame->xwindow, frame->xwindow,
event->time); event->time);
} }
/* don't do the rest of this if on client area */ /* don't do the rest of this if on client area */
if (control == META_FRAME_CONTROL_CLIENT_AREA) if (control == META_FRAME_CONTROL_CLIENT_AREA)
return FALSE; /* not on the frame, just passed through from client */ return FALSE; /* not on the frame, just passed through from client */
/* We want to shade even if we have a GrabOp, since we'll have a move grab /* We want to shade even if we have a GrabOp, since we'll have a move grab
* if we double click the titlebar. * if we double click the titlebar.
*/ */
@ -1191,7 +1191,7 @@ meta_frames_button_press_event (GtkWidget *widget,
} }
if (meta_core_get_grab_op (display) != META_GRAB_OP_NONE) if (meta_core_get_grab_op (display) != META_GRAB_OP_NONE)
return FALSE; /* already up to something */ return FALSE; /* already up to something */
if (event->button == 1 && if (event->button == 1 &&
(control == META_FRAME_CONTROL_MAXIMIZE || (control == META_FRAME_CONTROL_MAXIMIZE ||
@ -1226,7 +1226,7 @@ meta_frames_button_press_event (GtkWidget *widget,
/* get delta to convert to root coords */ /* get delta to convert to root coords */
dx = event->x_root - event->x; dx = event->x_root - event->x;
dy = event->y_root - event->y; dy = event->y_root - event->y;
/* Align to the right end of the menu rectangle if RTL */ /* Align to the right end of the menu rectangle if RTL */
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL) if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
dx += rect->width; dx += rect->width;
@ -1250,7 +1250,7 @@ meta_frames_button_press_event (GtkWidget *widget,
control == META_FRAME_CONTROL_RESIZE_W)) control == META_FRAME_CONTROL_RESIZE_W))
{ {
MetaGrabOp op; MetaGrabOp op;
op = META_GRAB_OP_NONE; op = META_GRAB_OP_NONE;
switch (control) switch (control)
@ -1305,7 +1305,7 @@ meta_frames_button_press_event (GtkWidget *widget,
META_CORE_GET_END); META_CORE_GET_END);
if (flags & META_FRAME_ALLOWS_MOVE) if (flags & META_FRAME_ALLOWS_MOVE)
{ {
meta_core_begin_grab_op (display, meta_core_begin_grab_op (display,
frame->xwindow, frame->xwindow,
META_GRAB_OP_MOVING, META_GRAB_OP_MOVING,
@ -1326,7 +1326,7 @@ meta_frames_button_press_event (GtkWidget *widget,
{ {
return meta_frame_right_click_event (frame, event); return meta_frame_right_click_event (frame, event);
} }
return TRUE; return TRUE;
} }
@ -1337,7 +1337,7 @@ meta_frames_button_release_event (GtkWidget *widget,
MetaUIFrame *frame; MetaUIFrame *frame;
MetaFrames *frames; MetaFrames *frames;
Display *display; Display *display;
frames = META_FRAMES (widget); frames = META_FRAMES (widget);
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
@ -1360,7 +1360,7 @@ meta_frames_button_release_event (GtkWidget *widget,
break; break;
case META_FRAME_CONTROL_MAXIMIZE: case META_FRAME_CONTROL_MAXIMIZE:
/* Focus the window on the maximize */ /* Focus the window on the maximize */
meta_core_user_focus (display, frame->xwindow, event->time); meta_core_user_focus (display, frame->xwindow, event->time);
meta_core_maximize (display, frame->xwindow); meta_core_maximize (display, frame->xwindow);
break; break;
case META_FRAME_CONTROL_UNMAXIMIZE: case META_FRAME_CONTROL_UNMAXIMIZE:
@ -1399,7 +1399,7 @@ meta_frames_button_release_event (GtkWidget *widget,
MetaFrameControl control = get_control (frames, frame, event->x, event->y); MetaFrameControl control = get_control (frames, frame, event->x, event->y);
meta_frames_update_prelit_control (frames, frame, control); meta_frames_update_prelit_control (frames, frame, control);
} }
return TRUE; return TRUE;
} }
@ -1413,9 +1413,9 @@ meta_frames_update_prelit_control (MetaFrames *frames,
meta_verbose ("Updating prelit control from %u to %u\n", meta_verbose ("Updating prelit control from %u to %u\n",
frame->prelit_control, control); frame->prelit_control, control);
cursor = META_CURSOR_DEFAULT; cursor = META_CURSOR_DEFAULT;
switch (control) switch (control)
{ {
case META_FRAME_CONTROL_CLIENT_AREA: case META_FRAME_CONTROL_CLIENT_AREA:
@ -1470,12 +1470,12 @@ meta_frames_update_prelit_control (MetaFrames *frames,
case META_FRAME_CONTROL_RESIZE_E: case META_FRAME_CONTROL_RESIZE_E:
cursor = META_CURSOR_EAST_RESIZE; cursor = META_CURSOR_EAST_RESIZE;
break; break;
} }
/* set/unset the prelight cursor */ /* set/unset the prelight cursor */
meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), meta_core_set_screen_cursor (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()),
frame->xwindow, frame->xwindow,
cursor); cursor);
switch (control) switch (control)
{ {
@ -1496,7 +1496,7 @@ meta_frames_update_prelit_control (MetaFrames *frames,
/* Only prelight buttons */ /* Only prelight buttons */
control = META_FRAME_CONTROL_NONE; control = META_FRAME_CONTROL_NONE;
break; break;
} }
if (control == frame->prelit_control) if (control == frame->prelit_control)
return; return;
@ -1546,7 +1546,7 @@ meta_frames_motion_notify_event (GtkWidget *widget,
/* Update prelit control and cursor */ /* Update prelit control and cursor */
meta_frames_update_prelit_control (frames, frame, control); meta_frames_update_prelit_control (frames, frame, control);
} }
return TRUE; return TRUE;
} }
@ -1562,7 +1562,7 @@ meta_frames_destroy_event (GtkWidget *widget,
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window)); frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
if (frame == NULL) if (frame == NULL)
return FALSE; return FALSE;
return TRUE; return TRUE;
} }
@ -1600,7 +1600,7 @@ clip_region_to_visible_frame_border (cairo_region_t *region,
MetaFrameBorders borders; MetaFrameBorders borders;
Display *display; Display *display;
int frame_width, frame_height; int frame_width, frame_height;
display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()); display = GDK_DISPLAY_XDISPLAY (gdk_display_get_default ());
meta_core_get (display, frame->xwindow, meta_core_get (display, frame->xwindow,
@ -1611,7 +1611,7 @@ clip_region_to_visible_frame_border (cairo_region_t *region,
META_CORE_GET_END); META_CORE_GET_END);
meta_theme_get_frame_borders (meta_theme_get_current (), meta_theme_get_frame_borders (meta_theme_get_current (),
type, frame->text_height, flags, type, frame->text_height, flags,
&borders); &borders);
/* Visible frame rect */ /* Visible frame rect */
@ -1768,7 +1768,7 @@ meta_frames_draw (GtkWidget *widget,
out: out:
cairo_region_destroy (region); cairo_region_destroy (region);
return TRUE; return TRUE;
} }
@ -1792,7 +1792,7 @@ meta_frames_paint (MetaFrames *frames,
for (i = 0; i < META_BUTTON_TYPE_LAST; i++) for (i = 0; i < META_BUTTON_TYPE_LAST; i++)
button_states[i] = META_BUTTON_STATE_NORMAL; button_states[i] = META_BUTTON_STATE_NORMAL;
/* Set prelight state */ /* Set prelight state */
switch (frame->prelit_control) switch (frame->prelit_control)
{ {
@ -1915,7 +1915,7 @@ meta_frames_enter_notify_event (GtkWidget *widget,
MetaUIFrame *frame; MetaUIFrame *frame;
MetaFrames *frames; MetaFrames *frames;
MetaFrameControl control; MetaFrameControl control;
frames = META_FRAMES (widget); frames = META_FRAMES (widget);
frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window)); frame = meta_frames_lookup_window (frames, GDK_WINDOW_XID (event->window));
@ -1924,7 +1924,7 @@ meta_frames_enter_notify_event (GtkWidget *widget,
control = get_control (frames, frame, event->x, event->y); control = get_control (frames, frame, event->x, event->y);
meta_frames_update_prelit_control (frames, frame, control); meta_frames_update_prelit_control (frames, frame, control);
return TRUE; return TRUE;
} }
@ -1942,7 +1942,7 @@ meta_frames_leave_notify_event (GtkWidget *widget,
return FALSE; return FALSE;
meta_frames_update_prelit_control (frames, frame, META_FRAME_CONTROL_NONE); meta_frames_update_prelit_control (frames, frame, META_FRAME_CONTROL_NONE);
return TRUE; return TRUE;
} }
@ -1951,7 +1951,7 @@ control_rect (MetaFrameControl control,
MetaFrameGeometry *fgeom) MetaFrameGeometry *fgeom)
{ {
GdkRectangle *rect; GdkRectangle *rect;
rect = NULL; rect = NULL;
switch (control) switch (control)
{ {
@ -2033,7 +2033,7 @@ get_control (MetaFrames *frames,
if (POINT_IN_RECT (x, y, client)) if (POINT_IN_RECT (x, y, client))
return META_FRAME_CONTROL_CLIENT_AREA; return META_FRAME_CONTROL_CLIENT_AREA;
if (POINT_IN_RECT (x, y, fgeom.close_rect.clickable)) if (POINT_IN_RECT (x, y, fgeom.close_rect.clickable))
return META_FRAME_CONTROL_DELETE; return META_FRAME_CONTROL_DELETE;
@ -2068,7 +2068,7 @@ get_control (MetaFrames *frames,
else else
return META_FRAME_CONTROL_MAXIMIZE; return META_FRAME_CONTROL_MAXIMIZE;
} }
if (POINT_IN_RECT (x, y, fgeom.shade_rect.clickable)) if (POINT_IN_RECT (x, y, fgeom.shade_rect.clickable))
{ {
return META_FRAME_CONTROL_SHADE; return META_FRAME_CONTROL_SHADE;

View File

@ -2,9 +2,9 @@
/* Metacity window frame manager widget */ /* Metacity window frame manager widget */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -79,7 +79,7 @@ struct _MetaUIFrame
int text_height; int text_height;
char *title; /* NULL once we have a layout */ char *title; /* NULL once we have a layout */
guint shape_applied : 1; guint shape_applied : 1;
/* FIXME get rid of this, it can just be in the MetaFrames struct */ /* FIXME get rid of this, it can just be in the MetaFrames struct */
MetaFrameControl prelit_control; MetaFrameControl prelit_control;
MetaButtonState button_state; MetaButtonState button_state;
@ -89,7 +89,7 @@ struct _MetaUIFrame
struct _MetaFrames struct _MetaFrames
{ {
GtkWindow parent_instance; GtkWindow parent_instance;
GHashTable *text_heights; GHashTable *text_heights;
GHashTable *frames; GHashTable *frames;

View File

@ -1,10 +1,10 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in * Copyright (C) 2001 Havoc Pennington, 99% copied from wrlib in
* WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima * WindowMaker, Copyright (C) 1997-2000 Dan Pascu and Alfredo Kojima
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. */ * along with this program; if not, see <http://www.gnu.org/licenses/>. */
@ -76,7 +76,7 @@ blank_pixbuf (int width, int height, gboolean no_padding)
if (no_padding) if (no_padding)
rowstride = width * 3; rowstride = width * 3;
else else
/* Always align rows to 32-bit boundaries */ /* Always align rows to 32-bit boundaries */
rowstride = 4 * ((3 * width + 3) / 4); rowstride = 4 * ((3 * width + 3) / 4);
buf = g_try_malloc (height * rowstride); buf = g_try_malloc (height * rowstride);
@ -194,7 +194,7 @@ meta_gradient_create_interwoven (int width,
const GdkRGBA colors2[2], const GdkRGBA colors2[2],
int thickness2) int thickness2)
{ {
int i, j, k, l, ll; int i, j, k, l, ll;
long r1, g1, b1, dr1, dg1, db1; long r1, g1, b1, dr1, dg1, db1;
long r2, g2, b2, dr2, dg2, db2; long r2, g2, b2, dr2, dg2, db2;
@ -202,14 +202,14 @@ meta_gradient_create_interwoven (int width,
unsigned char *ptr; unsigned char *ptr;
unsigned char *pixels; unsigned char *pixels;
int rowstride; int rowstride;
pixbuf = blank_pixbuf (width, height, FALSE); pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
r1 = (long)(colors1[0].red*0xffffff); r1 = (long)(colors1[0].red*0xffffff);
g1 = (long)(colors1[0].green*0xffffff); g1 = (long)(colors1[0].green*0xffffff);
b1 = (long)(colors1[0].blue*0xffffff); b1 = (long)(colors1[0].blue*0xffffff);
@ -229,7 +229,7 @@ meta_gradient_create_interwoven (int width,
for (i=0,k=0,l=0,ll=thickness1; i<height; i++) for (i=0,k=0,l=0,ll=thickness1; i<height; i++)
{ {
ptr = pixels + i * rowstride; ptr = pixels + i * rowstride;
if (k == 0) if (k == 0)
{ {
ptr[0] = (unsigned char) (r1>>16); ptr[0] = (unsigned char) (r1>>16);
@ -264,7 +264,7 @@ meta_gradient_create_interwoven (int width,
r1+=dr1; r1+=dr1;
g1+=dg1; g1+=dg1;
b1+=db1; b1+=db1;
r2+=dr2; r2+=dr2;
g2+=dg2; g2+=dg2;
b2+=db2; b2+=db2;
@ -277,20 +277,20 @@ meta_gradient_create_interwoven (int width,
*---------------------------------------------------------------------- *----------------------------------------------------------------------
* meta_gradient_create_horizontal-- * meta_gradient_create_horizontal--
* Renders a horizontal linear gradient of the specified size in the * Renders a horizontal linear gradient of the specified size in the
* GdkPixbuf format with a border of the specified type. * GdkPixbuf format with a border of the specified type.
* *
* Returns: * Returns:
* A 24bit GdkPixbuf with the gradient (no alpha channel). * A 24bit GdkPixbuf with the gradient (no alpha channel).
* *
* Side effects: * Side effects:
* None * None
*---------------------------------------------------------------------- *----------------------------------------------------------------------
*/ */
static GdkPixbuf* static GdkPixbuf*
meta_gradient_create_horizontal (int width, int height, meta_gradient_create_horizontal (int width, int height,
const GdkRGBA *from, const GdkRGBA *from,
const GdkRGBA *to) const GdkRGBA *to)
{ {
int i; int i;
long r, g, b, dr, dg, db; long r, g, b, dr, dg, db;
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
@ -303,22 +303,22 @@ meta_gradient_create_horizontal (int width, int height,
pixbuf = blank_pixbuf (width, height, FALSE); pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
ptr = pixels; ptr = pixels;
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
r0 = (guchar) (from->red * 0xff); r0 = (guchar) (from->red * 0xff);
g0 = (guchar) (from->green * 0xff); g0 = (guchar) (from->green * 0xff);
b0 = (guchar) (from->blue * 0xff); b0 = (guchar) (from->blue * 0xff);
rf = (guchar) (to->red * 0xff); rf = (guchar) (to->red * 0xff);
gf = (guchar) (to->green * 0xff); gf = (guchar) (to->green * 0xff);
bf = (guchar) (to->blue * 0xff); bf = (guchar) (to->blue * 0xff);
r = r0 << 16; r = r0 << 16;
g = g0 << 16; g = g0 << 16;
b = b0 << 16; b = b0 << 16;
dr = ((rf-r0)<<16)/(int)width; dr = ((rf-r0)<<16)/(int)width;
dg = ((gf-g0)<<16)/(int)width; dg = ((gf-g0)<<16)/(int)width;
db = ((bf-b0)<<16)/(int)width; db = ((bf-b0)<<16)/(int)width;
@ -367,21 +367,21 @@ meta_gradient_create_vertical (int width, int height,
int rf, gf, bf; int rf, gf, bf;
int rowstride; int rowstride;
unsigned char *pixels; unsigned char *pixels;
pixbuf = blank_pixbuf (width, height, FALSE); pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
r0 = (guchar) (from->red * 0xff); r0 = (guchar) (from->red * 0xff);
g0 = (guchar) (from->green * 0xff); g0 = (guchar) (from->green * 0xff);
b0 = (guchar) (from->blue * 0xff); b0 = (guchar) (from->blue * 0xff);
rf = (guchar) (to->red * 0xff); rf = (guchar) (to->red * 0xff);
gf = (guchar) (to->green * 0xff); gf = (guchar) (to->green * 0xff);
bf = (guchar) (to->blue * 0xff); bf = (guchar) (to->blue * 0xff);
r = r0<<16; r = r0<<16;
g = g0<<16; g = g0<<16;
b = b0<<16; b = b0<<16;
@ -393,7 +393,7 @@ meta_gradient_create_vertical (int width, int height,
for (i=0; i<height; i++) for (i=0; i<height; i++)
{ {
ptr = pixels + i * rowstride; ptr = pixels + i * rowstride;
ptr[0] = (unsigned char)(r>>16); ptr[0] = (unsigned char)(r>>16);
ptr[1] = (unsigned char)(g>>16); ptr[1] = (unsigned char)(g>>16);
ptr[2] = (unsigned char)(b>>16); ptr[2] = (unsigned char)(b>>16);
@ -436,7 +436,7 @@ meta_gradient_create_diagonal (int width, int height,
unsigned char *ptr; unsigned char *ptr;
unsigned char *pixels; unsigned char *pixels;
int rowstride; int rowstride;
if (width == 1) if (width == 1)
return meta_gradient_create_vertical (width, height, from, to); return meta_gradient_create_vertical (width, height, from, to);
else if (height == 1) else if (height == 1)
@ -445,7 +445,7 @@ meta_gradient_create_diagonal (int width, int height,
pixbuf = blank_pixbuf (width, height, FALSE); pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
@ -483,27 +483,27 @@ meta_gradient_create_multi_horizontal (int width, int height,
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
unsigned char *ptr; unsigned char *ptr;
unsigned char *pixels; unsigned char *pixels;
int width2; int width2;
int rowstride; int rowstride;
g_return_val_if_fail (count > 2, NULL); g_return_val_if_fail (count > 2, NULL);
pixbuf = blank_pixbuf (width, height, FALSE); pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
ptr = pixels; ptr = pixels;
if (count > width) if (count > width)
count = width; count = width;
if (count > 1) if (count > 1)
width2 = width/(count-1); width2 = width/(count-1);
else else
width2 = width; width2 = width;
k = 0; k = 0;
r = (long)(colors[0].red * 0xffffff); r = (long)(colors[0].red * 0xffffff);
@ -536,7 +536,7 @@ meta_gradient_create_multi_horizontal (int width, int height,
*ptr++ = (unsigned char)(g>>16); *ptr++ = (unsigned char)(g>>16);
*ptr++ = (unsigned char)(b>>16); *ptr++ = (unsigned char)(b>>16);
} }
/* copy the first line to the other lines */ /* copy the first line to the other lines */
for (i=1; i<height; i++) for (i=1; i<height; i++)
{ {
@ -557,25 +557,25 @@ meta_gradient_create_multi_vertical (int width, int height,
int height2; int height2;
int x; int x;
int rowstride; int rowstride;
g_return_val_if_fail (count > 2, NULL); g_return_val_if_fail (count > 2, NULL);
pixbuf = blank_pixbuf (width, height, FALSE); pixbuf = blank_pixbuf (width, height, FALSE);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
ptr = pixels; ptr = pixels;
if (count > height) if (count > height)
count = height; count = height;
if (count > 1) if (count > 1)
height2 = height/(count-1); height2 = height/(count-1);
else else
height2 = height; height2 = height;
k = 0; k = 0;
r = (long)(colors[0].red * 0xffffff); r = (long)(colors[0].red * 0xffffff);
@ -599,7 +599,7 @@ meta_gradient_create_multi_vertical (int width, int height,
memcpy (&(ptr[x*3]), ptr, (width - x)*3); memcpy (&(ptr[x*3]), ptr, (width - x)*3);
ptr += rowstride; ptr += rowstride;
r += dr; r += dr;
g += dg; g += dg;
b += db; b += db;
@ -623,14 +623,14 @@ meta_gradient_create_multi_vertical (int width, int height,
memcpy (&(ptr[x*3]), ptr, (width - x)*3); memcpy (&(ptr[x*3]), ptr, (width - x)*3);
ptr += rowstride; ptr += rowstride;
for (j=k+1; j<height; j++) for (j=k+1; j<height; j++)
{ {
memcpy (ptr, tmp, rowstride); memcpy (ptr, tmp, rowstride);
ptr += rowstride; ptr += rowstride;
} }
} }
return pixbuf; return pixbuf;
} }
@ -646,7 +646,7 @@ meta_gradient_create_multi_diagonal (int width, int height,
unsigned char *ptr; unsigned char *ptr;
unsigned char *pixels; unsigned char *pixels;
int rowstride; int rowstride;
g_return_val_if_fail (count > 2, NULL); g_return_val_if_fail (count > 2, NULL);
if (width == 1) if (width == 1)
@ -658,10 +658,10 @@ meta_gradient_create_multi_diagonal (int width, int height,
width, height); width, height);
if (pixbuf == NULL) if (pixbuf == NULL)
return NULL; return NULL;
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
if (count > width) if (count > width)
count = width; count = width;
if (count > height) if (count > height)
@ -708,12 +708,12 @@ simple_multiply_alpha (GdkPixbuf *pixbuf,
int row; int row;
g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
if (alpha == 255) if (alpha == 255)
return; return;
g_assert (gdk_pixbuf_get_has_alpha (pixbuf)); g_assert (gdk_pixbuf_get_has_alpha (pixbuf));
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
height = gdk_pixbuf_get_height (pixbuf); height = gdk_pixbuf_get_height (pixbuf);
@ -738,7 +738,7 @@ simple_multiply_alpha (GdkPixbuf *pixbuf,
*/ */
/* ((*p / 255.0) * (alpha / 255.0)) * 255; */ /* ((*p / 255.0) * (alpha / 255.0)) * 255; */
*p = (guchar) (((int) *p * (int) alpha) / (int) 255); *p = (guchar) (((int) *p * (int) alpha) / (int) 255);
++p; /* skip A */ ++p; /* skip A */
} }
@ -755,13 +755,13 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf,
long a, da; long a, da;
unsigned char *p; unsigned char *p;
unsigned char *pixels; unsigned char *pixels;
int width2; int width2;
int rowstride; int rowstride;
int width, height; int width, height;
unsigned char *gradient; unsigned char *gradient;
unsigned char *gradient_p; unsigned char *gradient_p;
unsigned char *gradient_end; unsigned char *gradient_end;
g_return_if_fail (n_alphas > 0); g_return_if_fail (n_alphas > 0);
if (n_alphas == 1) if (n_alphas == 1)
@ -770,24 +770,24 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf,
simple_multiply_alpha (pixbuf, alphas[0]); simple_multiply_alpha (pixbuf, alphas[0]);
return; return;
} }
width = gdk_pixbuf_get_width (pixbuf); width = gdk_pixbuf_get_width (pixbuf);
height = gdk_pixbuf_get_height (pixbuf); height = gdk_pixbuf_get_height (pixbuf);
gradient = g_new (unsigned char, width); gradient = g_new (unsigned char, width);
gradient_end = gradient + width; gradient_end = gradient + width;
if (n_alphas > width) if (n_alphas > width)
n_alphas = width; n_alphas = width;
if (n_alphas > 1) if (n_alphas > 1)
width2 = width / (n_alphas - 1); width2 = width / (n_alphas - 1);
else else
width2 = width; width2 = width;
a = alphas[0] << 8; a = alphas[0] << 8;
gradient_p = gradient; gradient_p = gradient;
/* render the gradient into an array */ /* render the gradient into an array */
for (i = 1; i < n_alphas; i++) for (i = 1; i < n_alphas; i++)
{ {
@ -796,7 +796,7 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf,
for (j = 0; j < width2; j++) for (j = 0; j < width2; j++)
{ {
*gradient_p++ = (a >> 8); *gradient_p++ = (a >> 8);
a += da; a += da;
} }
@ -808,11 +808,11 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf,
{ {
*gradient_p++ = a >> 8; *gradient_p++ = a >> 8;
} }
/* Now for each line of the pixbuf, fill in with the gradient */ /* Now for each line of the pixbuf, fill in with the gradient */
pixels = gdk_pixbuf_get_pixels (pixbuf); pixels = gdk_pixbuf_get_pixels (pixbuf);
rowstride = gdk_pixbuf_get_rowstride (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);
p = pixels; p = pixels;
i = 0; i = 0;
while (i < height) while (i < height)
@ -838,7 +838,7 @@ meta_gradient_add_alpha_horizontal (GdkPixbuf *pixbuf,
p = row_end; p = row_end;
++i; ++i;
} }
g_free (gradient); g_free (gradient);
} }
@ -851,21 +851,21 @@ meta_gradient_add_alpha (GdkPixbuf *pixbuf,
g_return_if_fail (GDK_IS_PIXBUF (pixbuf)); g_return_if_fail (GDK_IS_PIXBUF (pixbuf));
g_return_if_fail (gdk_pixbuf_get_has_alpha (pixbuf)); g_return_if_fail (gdk_pixbuf_get_has_alpha (pixbuf));
g_return_if_fail (n_alphas > 0); g_return_if_fail (n_alphas > 0);
switch (type) switch (type)
{ {
case META_GRADIENT_HORIZONTAL: case META_GRADIENT_HORIZONTAL:
meta_gradient_add_alpha_horizontal (pixbuf, alphas, n_alphas); meta_gradient_add_alpha_horizontal (pixbuf, alphas, n_alphas);
break; break;
case META_GRADIENT_VERTICAL: case META_GRADIENT_VERTICAL:
g_printerr ("metacity: vertical alpha channel gradient not implemented yet\n"); g_printerr ("metacity: vertical alpha channel gradient not implemented yet\n");
break; break;
case META_GRADIENT_DIAGONAL: case META_GRADIENT_DIAGONAL:
g_printerr ("metacity: diagonal alpha channel gradient not implemented yet\n"); g_printerr ("metacity: diagonal alpha channel gradient not implemented yet\n");
break; break;
case META_GRADIENT_LAST: case META_GRADIENT_LAST:
g_assert_not_reached (); g_assert_not_reached ();
break; break;

View File

@ -2,11 +2,11 @@
/* Mutter window menu */ /* Mutter window menu */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2004 Rob Adams * Copyright (C) 2004 Rob Adams
* Copyright (C) 2005 Elijah Newren * Copyright (C) 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -107,18 +107,18 @@ popup_position_func (GtkMenu *menu,
gboolean *push_in, gboolean *push_in,
gpointer user_data) gpointer user_data)
{ {
GtkRequisition req; GtkRequisition req;
GdkPoint *pos; GdkPoint *pos;
pos = user_data; pos = user_data;
gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL); gtk_widget_get_preferred_size (GTK_WIDGET (menu), &req, NULL);
*x = pos->x; *x = pos->x;
*y = pos->y; *y = pos->y;
if (meta_ui_get_direction() == META_UI_DIRECTION_RTL) if (meta_ui_get_direction() == META_UI_DIRECTION_RTL)
*x = MAX (0, *x - req.width); *x = MAX (0, *x - req.width);
/* Ensure onscreen */ /* Ensure onscreen */
*x = CLAMP (*x, 0, MAX (0, gdk_screen_width () - req.width)); *x = CLAMP (*x, 0, MAX (0, gdk_screen_width () - req.width));
@ -130,7 +130,7 @@ menu_closed (GtkMenu *widget,
gpointer data) gpointer data)
{ {
MetaWindowMenu *menu; MetaWindowMenu *menu;
menu = data; menu = data;
(* menu->func) (menu, (* menu->func) (menu,
@ -139,7 +139,7 @@ menu_closed (GtkMenu *widget,
gtk_get_current_event_time (), gtk_get_current_event_time (),
0, 0, 0, 0,
menu->data); menu->data);
/* menu may now be freed */ /* menu may now be freed */
} }
@ -147,9 +147,9 @@ static void
activate_cb (GtkWidget *menuitem, gpointer data) activate_cb (GtkWidget *menuitem, gpointer data)
{ {
MenuData *md; MenuData *md;
g_return_if_fail (GTK_IS_WIDGET (menuitem)); g_return_if_fail (GTK_IS_WIDGET (menuitem));
md = data; md = data;
(* md->menu->func) (md->menu, (* md->menu->func) (md->menu,
@ -169,7 +169,7 @@ activate_cb (GtkWidget *menuitem, gpointer data)
* accelerators. At the moment this means adding a _ if the name is of * accelerators. At the moment this means adding a _ if the name is of
* the form "Workspace n" where n is less than 10, and escaping any * the form "Workspace n" where n is less than 10, and escaping any
* other '_'s so they do not create inadvertant accelerators. * other '_'s so they do not create inadvertant accelerators.
* *
* The calling code owns the string, and is reponsible to free the * The calling code owns the string, and is reponsible to free the
* memory after use. * memory after use.
* *
@ -188,7 +188,7 @@ get_workspace_name_with_accel (Display *display,
name = meta_core_get_workspace_name_with_index (display, xroot, index); name = meta_core_get_workspace_name_with_index (display, xroot, index);
g_assert (name != NULL); g_assert (name != NULL);
/* /*
* If the name is of the form "Workspace x" where x is an unsigned * If the name is of the form "Workspace x" where x is an unsigned
* integer, insert a '_' before the number if it is less than 10 and * integer, insert a '_' before the number if it is less than 10 and
@ -199,7 +199,7 @@ get_workspace_name_with_accel (Display *display,
*(name + charcount)=='\0') *(name + charcount)=='\0')
{ {
char *new_name; char *new_name;
/* /*
* Above name is a pointer into the Workspace struct. Here we make * Above name is a pointer into the Workspace struct. Here we make
* a copy copy so we can have our wicked way with it. * a copy copy so we can have our wicked way with it.
@ -271,10 +271,10 @@ menu_item_new (MenuItem *menuitem, int workspace_id)
else if (menuitem->type == MENU_ITEM_CHECKBOX) else if (menuitem->type == MENU_ITEM_CHECKBOX)
{ {
mi = gtk_check_menu_item_new (); mi = gtk_check_menu_item_new ();
gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi), gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (mi),
menuitem->checked); menuitem->checked);
} }
else if (menuitem->type == MENU_ITEM_RADIOBUTTON) else if (menuitem->type == MENU_ITEM_RADIOBUTTON)
{ {
mi = gtk_check_menu_item_new (); mi = gtk_check_menu_item_new ();
@ -300,7 +300,7 @@ menu_item_new (MenuItem *menuitem, int workspace_id)
meta_accel_label_set_accelerator (META_ACCEL_LABEL (accel_label), meta_accel_label_set_accelerator (META_ACCEL_LABEL (accel_label),
key, mods); key, mods);
return mi; return mi;
} }
@ -320,18 +320,18 @@ meta_window_menu_new (MetaFrames *frames,
/* FIXME: Modifications to 'ops' should happen in meta_window_show_menu */ /* FIXME: Modifications to 'ops' should happen in meta_window_show_menu */
if (n_workspaces < 2) if (n_workspaces < 2)
ops &= ~(META_MENU_OP_STICK | META_MENU_OP_UNSTICK | META_MENU_OP_WORKSPACES); ops &= ~(META_MENU_OP_STICK | META_MENU_OP_UNSTICK | META_MENU_OP_WORKSPACES);
else if (n_workspaces == 2) else if (n_workspaces == 2)
/* #151183: If we only have two workspaces, disable the menu listing them. */ /* #151183: If we only have two workspaces, disable the menu listing them. */
ops &= ~(META_MENU_OP_WORKSPACES); ops &= ~(META_MENU_OP_WORKSPACES);
menu = g_new (MetaWindowMenu, 1); menu = g_new (MetaWindowMenu, 1);
menu->frames = frames; menu->frames = frames;
menu->client_xwindow = client_xwindow; menu->client_xwindow = client_xwindow;
menu->func = func; menu->func = func;
menu->data = data; menu->data = data;
menu->ops = ops; menu->ops = ops;
menu->insensitive = insensitive; menu->insensitive = insensitive;
menu->menu = gtk_menu_new (); menu->menu = gtk_menu_new ();
gtk_menu_set_screen (GTK_MENU (menu->menu), gtk_menu_set_screen (GTK_MENU (menu->menu),
@ -450,12 +450,12 @@ meta_window_menu_new (MetaFrames *frames,
if (insensitive & menuitem.op) if (insensitive & menuitem.op)
gtk_widget_set_sensitive (mi, FALSE); gtk_widget_set_sensitive (mi, FALSE);
md = g_new (MenuData, 1); md = g_new (MenuData, 1);
md->menu = menu; md->menu = menu;
md->op = menuitem.op; md->op = menuitem.op;
g_signal_connect_data (G_OBJECT (mi), g_signal_connect_data (G_OBJECT (mi),
"activate", "activate",
G_CALLBACK (activate_cb), G_CALLBACK (activate_cb),
@ -466,15 +466,15 @@ meta_window_menu_new (MetaFrames *frames,
if (mi) if (mi)
{ {
gtk_menu_shell_append (GTK_MENU_SHELL (menu->menu), mi); gtk_menu_shell_append (GTK_MENU_SHELL (menu->menu), mi);
gtk_widget_show (mi); gtk_widget_show (mi);
} }
} }
} }
g_signal_connect (menu->menu, "selection_done", g_signal_connect (menu->menu, "selection_done",
G_CALLBACK (menu_closed), menu); G_CALLBACK (menu_closed), menu);
return menu; return menu;
} }
@ -487,7 +487,7 @@ meta_window_menu_popup (MetaWindowMenu *menu,
guint32 timestamp) guint32 timestamp)
{ {
GdkPoint *pt; GdkPoint *pt;
pt = g_new (GdkPoint, 1); pt = g_new (GdkPoint, 1);
g_object_set_data_full (G_OBJECT (menu->menu), g_object_set_data_full (G_OBJECT (menu->menu),
@ -497,7 +497,7 @@ meta_window_menu_popup (MetaWindowMenu *menu,
pt->x = root_x; pt->x = root_x;
pt->y = root_y; pt->y = root_y;
gtk_menu_popup (GTK_MENU (menu->menu), gtk_menu_popup (GTK_MENU (menu->menu),
NULL, NULL, NULL, NULL,
popup_position_func, pt, popup_position_func, pt,

View File

@ -2,9 +2,9 @@
/* Mutter window menu */ /* Mutter window menu */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -271,9 +271,9 @@ meta_accel_label_draw (GtkWidget *widget,
cairo_translate (cr, ac_width, 0); cairo_translate (cr, ac_width, 0);
if (gtk_label_get_ellipsize (label)) if (gtk_label_get_ellipsize (label))
pango_layout_set_width (label_layout, pango_layout_set_width (label_layout,
pango_layout_get_width (label_layout) pango_layout_get_width (label_layout)
- ac_width * PANGO_SCALE); - ac_width * PANGO_SCALE);
allocation.width -= ac_width; allocation.width -= ac_width;
gtk_widget_set_allocation (widget, &allocation); gtk_widget_set_allocation (widget, &allocation);
if (GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw) if (GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw)
@ -283,7 +283,7 @@ meta_accel_label_draw (GtkWidget *widget,
gtk_widget_set_allocation (widget, &allocation); gtk_widget_set_allocation (widget, &allocation);
if (gtk_label_get_ellipsize (label)) if (gtk_label_get_ellipsize (label))
pango_layout_set_width (label_layout, pango_layout_set_width (label_layout,
pango_layout_get_width (label_layout) pango_layout_get_width (label_layout)
+ ac_width * PANGO_SCALE); + ac_width * PANGO_SCALE);
cairo_restore (cr); cairo_restore (cr);
@ -318,7 +318,7 @@ meta_accel_label_draw (GtkWidget *widget,
if (GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw) if (GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw)
GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw (widget, cr); GTK_WIDGET_CLASS (meta_accel_label_parent_class)->draw (widget, cr);
} }
return FALSE; return FALSE;
} }

View File

@ -2,9 +2,9 @@
/* Metacity resizing-terminal-window feedback */ /* Metacity resizing-terminal-window feedback */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -30,13 +30,13 @@ struct _MetaResizePopup
GtkWidget *size_window; GtkWidget *size_window;
GtkWidget *size_label; GtkWidget *size_label;
Display *display; Display *display;
int screen_number; int screen_number;
int vertical_size; int vertical_size;
int horizontal_size; int horizontal_size;
gboolean showing; gboolean showing;
MetaRectangle rect; MetaRectangle rect;
}; };
@ -50,7 +50,7 @@ meta_ui_resize_popup_new (Display *display,
popup->display = display; popup->display = display;
popup->screen_number = screen_number; popup->screen_number = screen_number;
return popup; return popup;
} }
@ -58,10 +58,10 @@ void
meta_ui_resize_popup_free (MetaResizePopup *popup) meta_ui_resize_popup_free (MetaResizePopup *popup)
{ {
g_return_if_fail (popup != NULL); g_return_if_fail (popup != NULL);
if (popup->size_window) if (popup->size_window)
gtk_widget_destroy (popup->size_window); gtk_widget_destroy (popup->size_window);
g_free (popup); g_free (popup);
} }
@ -125,9 +125,9 @@ update_size_window (MetaResizePopup *popup)
char *str; char *str;
int x, y; int x, y;
int width, height; int width, height;
g_return_if_fail (popup->size_window != NULL); g_return_if_fail (popup->size_window != NULL);
/* Translators: This represents the size of a window. The first number is /* Translators: This represents the size of a window. The first number is
* the width of the window and the second is the height. * the width of the window and the second is the height.
*/ */
@ -143,7 +143,7 @@ update_size_window (MetaResizePopup *popup)
x = popup->rect.x + (popup->rect.width - width) / 2; x = popup->rect.x + (popup->rect.width - width) / 2;
y = popup->rect.y + (popup->rect.height - height) / 2; y = popup->rect.y + (popup->rect.height - height) / 2;
if (gtk_widget_get_realized (popup->size_window)) if (gtk_widget_get_realized (popup->size_window))
{ {
/* using move_resize to avoid jumpiness */ /* using move_resize to avoid jumpiness */
@ -165,7 +165,7 @@ sync_showing (MetaResizePopup *popup)
{ {
if (popup->size_window) if (popup->size_window)
gtk_widget_show (popup->size_window); gtk_widget_show (popup->size_window);
if (popup->size_window && gtk_widget_get_realized (popup->size_window)) if (popup->size_window && gtk_widget_get_realized (popup->size_window))
gdk_window_raise (gtk_widget_get_window (popup->size_window)); gdk_window_raise (gtk_widget_get_window (popup->size_window));
} }
@ -186,11 +186,11 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
{ {
gboolean need_update_size; gboolean need_update_size;
int display_w, display_h; int display_w, display_h;
g_return_if_fail (popup != NULL); g_return_if_fail (popup != NULL);
need_update_size = FALSE; need_update_size = FALSE;
display_w = rect.width - base_width; display_w = rect.width - base_width;
if (width_inc > 0) if (width_inc > 0)
display_w /= width_inc; display_w /= width_inc;
@ -203,17 +203,17 @@ meta_ui_resize_popup_set (MetaResizePopup *popup,
display_w != popup->horizontal_size || display_w != popup->horizontal_size ||
display_h != popup->vertical_size) display_h != popup->vertical_size)
need_update_size = TRUE; need_update_size = TRUE;
popup->rect = rect; popup->rect = rect;
popup->vertical_size = display_h; popup->vertical_size = display_h;
popup->horizontal_size = display_w; popup->horizontal_size = display_w;
if (need_update_size) if (need_update_size)
{ {
ensure_size_window (popup); ensure_size_window (popup);
update_size_window (popup); update_size_window (popup);
} }
sync_showing (popup); sync_showing (popup);
} }
@ -222,7 +222,7 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup,
gboolean showing) gboolean showing)
{ {
g_return_if_fail (popup != NULL); g_return_if_fail (popup != NULL);
if (showing == popup->showing) if (showing == popup->showing)
return; return;
@ -233,6 +233,6 @@ meta_ui_resize_popup_set_showing (MetaResizePopup *popup,
ensure_size_window (popup); ensure_size_window (popup);
update_size_window (popup); update_size_window (popup);
} }
sync_showing (popup); sync_showing (popup);
} }

View File

@ -2,9 +2,9 @@
/* Mutter resizing-terminal-window feedback */ /* Mutter resizing-terminal-window feedback */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,9 +2,9 @@
/* Mutter gradient test program */ /* Mutter gradient test program */
/* /*
* Copyright (C) 2002 Havoc Pennington * Copyright (C) 2002 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. */ * along with this program; if not, see <http://www.gnu.org/licenses/>. */
@ -32,9 +32,9 @@ draw_checkerboard (cairo_t *cr,
{ {
gint i, j, xcount, ycount; gint i, j, xcount, ycount;
GdkRGBA color1, color2; GdkRGBA color1, color2;
#define CHECK_SIZE 10 #define CHECK_SIZE 10
#define SPACING 2 #define SPACING 2
color1.red = 30000. / 65535.; color1.red = 30000. / 65535.;
color1.green = 30000. / 65535.; color1.green = 30000. / 65535.;
@ -83,7 +83,7 @@ render_simple (cairo_t *cr,
{ {
GdkPixbuf *pixbuf; GdkPixbuf *pixbuf;
GdkRGBA from, to; GdkRGBA from, to;
gdk_rgba_parse (&from, "blue"); gdk_rgba_parse (&from, "blue");
gdk_rgba_parse (&to, "green"); gdk_rgba_parse (&to, "green");
@ -94,23 +94,23 @@ render_simple (cairo_t *cr,
if (with_alpha) if (with_alpha)
{ {
const unsigned char alphas[] = { 0xff, 0xaa, 0x2f, 0x0, 0xcc, 0xff, 0xff }; const unsigned char alphas[] = { 0xff, 0xaa, 0x2f, 0x0, 0xcc, 0xff, 0xff };
if (!gdk_pixbuf_get_has_alpha (pixbuf)) if (!gdk_pixbuf_get_has_alpha (pixbuf))
{ {
GdkPixbuf *new_pixbuf; GdkPixbuf *new_pixbuf;
new_pixbuf = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0); new_pixbuf = gdk_pixbuf_add_alpha (pixbuf, FALSE, 0, 0, 0);
g_object_unref (G_OBJECT (pixbuf)); g_object_unref (G_OBJECT (pixbuf));
pixbuf = new_pixbuf; pixbuf = new_pixbuf;
} }
meta_gradient_add_alpha (pixbuf, meta_gradient_add_alpha (pixbuf,
alphas, G_N_ELEMENTS (alphas), alphas, G_N_ELEMENTS (alphas),
META_GRADIENT_HORIZONTAL); META_GRADIENT_HORIZONTAL);
draw_checkerboard (cr , width, height); draw_checkerboard (cr , width, height);
} }
gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0); gdk_cairo_set_source_pixbuf (cr, pixbuf, 0, 0);
cairo_rectangle (cr, 0, 0, width, height); cairo_rectangle (cr, 0, 0, width, height);
cairo_fill (cr); cairo_fill (cr);
@ -253,13 +253,13 @@ create_gradient_window (const char *title,
window = gtk_window_new (GTK_WINDOW_TOPLEVEL); window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
gtk_window_set_title (GTK_WINDOW (window), title); gtk_window_set_title (GTK_WINDOW (window), title);
drawing_area = gtk_drawing_area_new (); drawing_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (drawing_area, 1, 1); gtk_widget_set_size_request (drawing_area, 1, 1);
gtk_window_set_default_size (GTK_WINDOW (window), 175, 175); gtk_window_set_default_size (GTK_WINDOW (window), 175, 175);
g_signal_connect (G_OBJECT (drawing_area), g_signal_connect (G_OBJECT (drawing_area),
"draw", "draw",
G_CALLBACK (draw_callback), G_CALLBACK (draw_callback),
@ -268,7 +268,7 @@ create_gradient_window (const char *title,
gtk_container_add (GTK_CONTAINER (window), drawing_area); gtk_container_add (GTK_CONTAINER (window), drawing_area);
gtk_widget_show_all (window); gtk_widget_show_all (window);
return window; return window;
} }

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,9 @@
/* Metacity Theme Rendering */ /* Metacity Theme Rendering */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -57,7 +57,7 @@ typedef struct _MetaGradientSpec MetaGradientSpec;
* MetaAlphaGradientSpec: (skip) * MetaAlphaGradientSpec: (skip)
* *
*/ */
typedef struct _MetaAlphaGradientSpec MetaAlphaGradientSpec; typedef struct _MetaAlphaGradientSpec MetaAlphaGradientSpec;
/** /**
* MetaColorSpec: (skip) * MetaColorSpec: (skip)
* *
@ -131,14 +131,14 @@ struct _MetaFrameLayout
{ {
/** Reference count. */ /** Reference count. */
int refcount; int refcount;
/** Size of left side */ /** Size of left side */
int left_width; int left_width;
/** Size of right side */ /** Size of right side */
int right_width; int right_width;
/** Size of bottom side */ /** Size of bottom side */
int bottom_height; int bottom_height;
/** Border of blue title region /** Border of blue title region
* \bug (blue?!) * \bug (blue?!)
**/ **/
@ -146,12 +146,12 @@ struct _MetaFrameLayout
/** Extra height for inside of title region, above the font height */ /** Extra height for inside of title region, above the font height */
int title_vertical_pad; int title_vertical_pad;
/** Right indent of buttons from edges of frame */ /** Right indent of buttons from edges of frame */
int right_titlebar_edge; int right_titlebar_edge;
/** Left indent of buttons from edges of frame */ /** Left indent of buttons from edges of frame */
int left_titlebar_edge; int left_titlebar_edge;
/** /**
* Sizing rule of buttons, either META_BUTTON_SIZING_ASPECT * Sizing rule of buttons, either META_BUTTON_SIZING_ASPECT
* (in which case button_aspect will be honoured, and * (in which case button_aspect will be honoured, and
@ -167,7 +167,7 @@ struct _MetaFrameLayout
* Otherwise we figure out the height from the button_border. * Otherwise we figure out the height from the button_border.
*/ */
double button_aspect; double button_aspect;
/** Width of a button; set even when we are using aspect sizing */ /** Width of a button; set even when we are using aspect sizing */
int button_width; int button_width;
@ -179,7 +179,7 @@ struct _MetaFrameLayout
/** scale factor for title text */ /** scale factor for title text */
double title_scale; double title_scale;
/** Whether title text will be displayed */ /** Whether title text will be displayed */
guint has_title : 1; guint has_title : 1;
@ -218,7 +218,7 @@ struct _MetaFrameGeometry
MetaFrameBorders borders; MetaFrameBorders borders;
int width; int width;
int height; int height;
GdkRectangle title_rect; GdkRectangle title_rect;
@ -230,7 +230,7 @@ struct _MetaFrameGeometry
/* used for a memset hack */ /* used for a memset hack */
#define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect)) #define ADDRESS_OF_BUTTON_RECTS(fgeom) (((char*)(fgeom)) + G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
#define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, right_single_background) + sizeof (GdkRectangle) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect)) #define LENGTH_OF_BUTTON_RECTS (G_STRUCT_OFFSET (MetaFrameGeometry, right_single_background) + sizeof (GdkRectangle) - G_STRUCT_OFFSET (MetaFrameGeometry, close_rect))
/* The button rects (if changed adjust memset hack) */ /* The button rects (if changed adjust memset hack) */
MetaButtonSpace close_rect; MetaButtonSpace close_rect;
MetaButtonSpace max_rect; MetaButtonSpace max_rect;
@ -258,7 +258,7 @@ struct _MetaFrameGeometry
MetaButtonLayout button_layout; MetaButtonLayout button_layout;
int n_left_buttons; int n_left_buttons;
int n_right_buttons; int n_right_buttons;
/* Round corners */ /* Round corners */
guint top_left_corner_rounded_radius; guint top_left_corner_rounded_radius;
guint top_right_corner_rounded_radius; guint top_right_corner_rounded_radius;
@ -363,14 +363,14 @@ typedef enum
/** Clip to a rectangle */ /** Clip to a rectangle */
META_DRAW_CLIP, META_DRAW_CLIP,
/* Texture thingies */ /* Texture thingies */
/** Just a filled rectangle with alpha */ /** Just a filled rectangle with alpha */
META_DRAW_TINT, META_DRAW_TINT,
META_DRAW_GRADIENT, META_DRAW_GRADIENT,
META_DRAW_IMAGE, META_DRAW_IMAGE,
/** GTK theme engine stuff */ /** GTK theme engine stuff */
META_DRAW_GTK_ARROW, META_DRAW_GTK_ARROW,
META_DRAW_GTK_BOX, META_DRAW_GTK_BOX,
@ -459,7 +459,7 @@ struct _MetaDrawSpec
* otherwise it is zero. * otherwise it is zero.
*/ */
int value; int value;
/** A list of tokens in the expression. */ /** A list of tokens in the expression. */
PosToken *tokens; PosToken *tokens;
@ -517,7 +517,7 @@ struct _MetaDrawOp
MetaDrawSpec *width; MetaDrawSpec *width;
MetaDrawSpec *height; MetaDrawSpec *height;
} clip; } clip;
struct { struct {
MetaColorSpec *color_spec; MetaColorSpec *color_spec;
MetaAlphaGradientSpec *alpha_spec; MetaAlphaGradientSpec *alpha_spec;
@ -551,7 +551,7 @@ struct _MetaDrawOp
unsigned int vertical_stripes : 1; unsigned int vertical_stripes : 1;
unsigned int horizontal_stripes : 1; unsigned int horizontal_stripes : 1;
} image; } image;
struct { struct {
GtkStateFlags state; GtkStateFlags state;
GtkShadowType shadow; GtkShadowType shadow;
@ -577,7 +577,7 @@ struct _MetaDrawOp
GtkStateFlags state; GtkStateFlags state;
MetaDrawSpec *x; MetaDrawSpec *x;
MetaDrawSpec *y1; MetaDrawSpec *y1;
MetaDrawSpec *y2; MetaDrawSpec *y2;
} gtk_vline; } gtk_vline;
struct { struct {
@ -615,7 +615,7 @@ struct _MetaDrawOp
MetaDrawSpec *tile_width; MetaDrawSpec *tile_width;
MetaDrawSpec *tile_height; MetaDrawSpec *tile_height;
} tile; } tile;
} data; } data;
}; };
@ -690,7 +690,7 @@ typedef enum
* | rather than | * | rather than |
* *
*/ */
/* entire frame */ /* entire frame */
META_FRAME_PIECE_ENTIRE_BACKGROUND, META_FRAME_PIECE_ENTIRE_BACKGROUND,
/* entire titlebar background */ /* entire titlebar background */
@ -756,7 +756,7 @@ struct _MetaFrameStyle
}; };
/* Kinds of frame... /* Kinds of frame...
* *
* normal -> noresize / vert only / horz only / both * normal -> noresize / vert only / horz only / both
* focused / unfocused * focused / unfocused
* max -> focused / unfocused * max -> focused / unfocused
@ -768,7 +768,7 @@ struct _MetaFrameStyle
* *
* 14 window states times 7 or 8 window types. Except some * 14 window states times 7 or 8 window types. Except some
* window types never get a frame so that narrows it down a bit. * window types never get a frame so that narrows it down a bit.
* *
*/ */
typedef enum typedef enum
{ {

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,9 @@
/* Mutter interface for talking to GTK+ UI module */ /* Mutter interface for talking to GTK+ UI module */
/* /*
* Copyright (C) 2002 Havoc Pennington * Copyright (C) 2002 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -330,7 +330,7 @@ meta_ui_create_frame_window (MetaUI *ui,
gint attributes_mask; gint attributes_mask;
GdkWindow *window; GdkWindow *window;
GdkVisual *visual; GdkVisual *visual;
/* Default depth/visual handles clients with weird visuals; they can /* Default depth/visual handles clients with weird visuals; they can
* always be children of the root depth/visual obviously, but * 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 * e.g. DRI games can't be children of a parent that has the same
@ -379,7 +379,7 @@ meta_ui_create_frame_window (MetaUI *ui,
&attrs, attributes_mask); &attrs, attributes_mask);
gdk_window_resize (window, width, height); gdk_window_resize (window, width, height);
meta_frames_manage_window (ui->frames, GDK_WINDOW_XID (window), window); meta_frames_manage_window (ui->frames, GDK_WINDOW_XID (window), window);
return GDK_WINDOW_XID (window); return GDK_WINDOW_XID (window);
@ -602,7 +602,7 @@ meta_ui_get_default_window_icon (MetaUI *ui)
} }
g_object_ref (G_OBJECT (default_icon)); g_object_ref (G_OBJECT (default_icon));
return default_icon; return default_icon;
} }
@ -637,7 +637,7 @@ meta_ui_get_default_mini_icon (MetaUI *ui)
} }
g_object_ref (G_OBJECT (default_icon)); g_object_ref (G_OBJECT (default_icon));
return default_icon; return default_icon;
} }

View File

@ -2,9 +2,9 @@
/* Mutter interface for talking to GTK+ UI module */ /* Mutter interface for talking to GTK+ UI module */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -55,7 +55,7 @@ struct _ListNode
struct _AgGetPropertyTask struct _AgGetPropertyTask
{ {
ListNode node; ListNode node;
AgPerDisplayData *dd; AgPerDisplayData *dd;
Window window; Window window;
Atom property; Atom property;
@ -77,7 +77,7 @@ struct _AgPerDisplayData
{ {
ListNode node; ListNode node;
_XAsyncHandler async; _XAsyncHandler async;
Display *display; Display *display;
ListNode *pending_tasks; ListNode *pending_tasks;
ListNode *pending_tasks_tail; ListNode *pending_tasks_tail;
@ -96,7 +96,7 @@ append_to_list (ListNode **head,
ListNode *task) ListNode *task)
{ {
task->next = NULL; task->next = NULL;
if (*tail == NULL) if (*tail == NULL)
{ {
assert (*head == NULL); assert (*head == NULL);
@ -131,10 +131,10 @@ remove_from_list (ListNode **head,
if (node == *tail) if (node == *tail)
*tail = prev; *tail = prev;
break; break;
} }
prev = node; prev = node;
node = node->next; node = node->next;
} }
@ -152,7 +152,7 @@ move_to_completed (AgPerDisplayData *dd,
remove_from_list (&dd->pending_tasks, remove_from_list (&dd->pending_tasks,
&dd->pending_tasks_tail, &dd->pending_tasks_tail,
&task->node); &task->node);
append_to_list (&dd->completed_tasks, append_to_list (&dd->completed_tasks,
&dd->completed_tasks_tail, &dd->completed_tasks_tail,
&task->node); &task->node);
@ -187,18 +187,18 @@ find_pending_by_request_sequence (AgPerDisplayData *dd,
* I'm not sure this is 100% guaranteed, if it is, * I'm not sure this is 100% guaranteed, if it is,
* it would be a big speedup. * it would be a big speedup.
*/ */
node = dd->pending_tasks; node = dd->pending_tasks;
while (node != NULL) while (node != NULL)
{ {
AgGetPropertyTask *task = (AgGetPropertyTask*) node; AgGetPropertyTask *task = (AgGetPropertyTask*) node;
if (task->request_seq == request_seq) if (task->request_seq == request_seq)
return task; return task;
node = node->next; node = node->next;
} }
return NULL; return NULL;
} }
@ -216,12 +216,12 @@ async_get_property_handler (Display *dpy,
int bytes_read; int bytes_read;
dd = (AgPerDisplayData*) data; dd = (AgPerDisplayData*) data;
#if 0 #if 0
printf ("%s: seeing request seq %ld buflen %d\n", __FUNCTION__, printf ("%s: seeing request seq %ld buflen %d\n", __FUNCTION__,
dpy->last_request_read, len); dpy->last_request_read, len);
#endif #endif
task = find_pending_by_request_sequence (dd, dpy->last_request_read); task = find_pending_by_request_sequence (dd, dpy->last_request_read);
if (task == NULL) if (task == NULL)
@ -231,7 +231,7 @@ async_get_property_handler (Display *dpy,
task->have_reply = True; task->have_reply = True;
move_to_completed (dd, task); move_to_completed (dd, task);
/* read bytes so far */ /* read bytes so far */
bytes_read = SIZEOF (xReply); bytes_read = SIZEOF (xReply);
@ -240,7 +240,7 @@ async_get_property_handler (Display *dpy,
xError errbuf; xError errbuf;
task->error = rep->error.errorCode; task->error = rep->error.errorCode;
#ifdef DEBUG_SPEW #ifdef DEBUG_SPEW
printf ("%s: error code = %d (ignoring error, eating %d bytes, generic.length = %ld)\n", printf ("%s: error code = %d (ignoring error, eating %d bytes, generic.length = %ld)\n",
__FUNCTION__, task->error, (SIZEOF (xError) - bytes_read), __FUNCTION__, task->error, (SIZEOF (xError) - bytes_read),
@ -263,7 +263,7 @@ async_get_property_handler (Display *dpy,
_XGetAsyncReply (dpy, (char *)&errbuf, rep, buf, len, _XGetAsyncReply (dpy, (char *)&errbuf, rep, buf, len,
(SIZEOF (xError) - bytes_read) >> 2, /* in 32-bit words */ (SIZEOF (xError) - bytes_read) >> 2, /* in 32-bit words */
False); /* really seems like it should be True */ False); /* really seems like it should be True */
return True; return True;
} }
@ -368,7 +368,7 @@ async_get_property_handler (Display *dpy,
char *netdata; char *netdata;
char *lptr; char *lptr;
char *end_lptr; char *end_lptr;
/* Store the 32-bit values in the end of the array */ /* Store the 32-bit values in the end of the array */
netdata = task->data + nbytes / 2; netdata = task->data + nbytes / 2;
@ -377,7 +377,7 @@ async_get_property_handler (Display *dpy,
netbytes); netbytes);
/* Now move the 32-bit values to the front */ /* Now move the 32-bit values to the front */
lptr = task->data; lptr = task->data;
end_lptr = task->data + nbytes; end_lptr = task->data + nbytes;
while (lptr != end_lptr) while (lptr != end_lptr)
@ -411,7 +411,7 @@ async_get_property_handler (Display *dpy,
#if 0 #if 0
xError error; xError error;
#endif #endif
task->error = BadImplementation; task->error = BadImplementation;
#if 0 #if 0
@ -468,21 +468,21 @@ get_display_data (Display *display,
{ {
ListNode *node; ListNode *node;
AgPerDisplayData *dd; AgPerDisplayData *dd;
node = display_datas; node = display_datas;
while (node != NULL) while (node != NULL)
{ {
dd = (AgPerDisplayData*) node; dd = (AgPerDisplayData*) node;
if (dd->display == display) if (dd->display == display)
return dd; return dd;
node = node->next; node = node->next;
} }
if (!create) if (!create)
return NULL; return NULL;
dd = Xcalloc (1, sizeof (AgPerDisplayData)); dd = Xcalloc (1, sizeof (AgPerDisplayData));
if (dd == NULL) if (dd == NULL)
return NULL; return NULL;
@ -496,7 +496,7 @@ get_display_data (Display *display,
append_to_list (&display_datas, append_to_list (&display_datas,
&display_datas_tail, &display_datas_tail,
&dd->node); &dd->node);
return dd; return dd;
} }
@ -524,8 +524,8 @@ ag_task_create (Display *dpy,
{ {
AgGetPropertyTask *task; AgGetPropertyTask *task;
xGetPropertyReq *req; xGetPropertyReq *req;
AgPerDisplayData *dd; AgPerDisplayData *dd;
/* Fire up our request */ /* Fire up our request */
LockDisplay (dpy); LockDisplay (dpy);
@ -535,7 +535,7 @@ ag_task_create (Display *dpy,
UnlockDisplay (dpy); UnlockDisplay (dpy);
return NULL; return NULL;
} }
GetReq (GetProperty, req); GetReq (GetProperty, req);
req->window = window; req->window = window;
req->property = property; req->property = property;
@ -561,7 +561,7 @@ ag_task_create (Display *dpy,
&dd->pending_tasks_tail, &dd->pending_tasks_tail,
&task->node); &task->node);
dd->n_tasks_pending += 1; dd->n_tasks_pending += 1;
UnlockDisplay (dpy); UnlockDisplay (dpy);
SyncHandle (); SyncHandle ();
@ -593,13 +593,13 @@ ag_task_get_reply_and_free (AgGetPropertyTask *task,
*prop = NULL; *prop = NULL;
dpy = task->dd->display; /* Xlib macros require a variable named "dpy" */ dpy = task->dd->display; /* Xlib macros require a variable named "dpy" */
if (task->error != Success) if (task->error != Success)
{ {
Status s = task->error; Status s = task->error;
free_task (task); free_task (task);
return s; return s;
} }
@ -620,7 +620,7 @@ ag_task_get_reply_and_free (AgGetPropertyTask *task,
SyncHandle (); SyncHandle ();
free_task (task); free_task (task);
return Success; return Success;
} }
@ -657,7 +657,7 @@ ag_get_next_completed_task (Display *display)
if (dd == NULL) if (dd == NULL)
return NULL; return NULL;
#ifdef DEBUG_SPEW #ifdef DEBUG_SPEW
printf ("%d pending %d completed\n", printf ("%d pending %d completed\n",
dd->n_tasks_pending, dd->n_tasks_pending,

View File

@ -4,16 +4,16 @@
/* /*
* Copyright (C) 2002 Havoc Pennington * Copyright (C) 2002 Havoc Pennington
* *
* Permission to use, copy, modify, distribute, and sell this software * Permission to use, copy, modify, distribute, and sell this software
* and its documentation for any purpose is hereby granted without * and its documentation for any purpose is hereby granted without
* fee, provided that the above copyright notice appear in all copies * fee, provided that the above copyright notice appear in all copies
* and that both that copyright notice and this permission notice * and that both that copyright notice and this permission notice
* appear in supporting documentation. * appear in supporting documentation.
* *
* The above copyright notice and this permission notice shall be * The above copyright notice and this permission notice shall be
* included in all copies or substantial portions of the Software. * included in all copies or substantial portions of the Software.
* *
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND

View File

@ -2,9 +2,9 @@
/* Mutter window group private header */ /* Mutter window group private header */
/* /*
* Copyright (C) 2002 Red Hat Inc. * Copyright (C) 2002 Red Hat Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,9 +2,9 @@
/* MetaGroup property handling */ /* MetaGroup property handling */
/* /*
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -65,16 +65,16 @@ meta_group_reload_properties (MetaGroup *group,
g_return_if_fail (properties != NULL); g_return_if_fail (properties != NULL);
g_return_if_fail (n_properties > 0); g_return_if_fail (n_properties > 0);
values = g_new0 (MetaPropValue, n_properties); values = g_new0 (MetaPropValue, n_properties);
i = 0; i = 0;
while (i < n_properties) while (i < n_properties)
{ {
init_prop_value (group->display, properties[i], &values[i]); init_prop_value (group->display, properties[i], &values[i]);
++i; ++i;
} }
meta_prop_get_values (group->display, group->group_leader, meta_prop_get_values (group->display, group->group_leader,
values, n_properties); values, n_properties);
@ -82,12 +82,12 @@ meta_group_reload_properties (MetaGroup *group,
while (i < n_properties) while (i < n_properties)
{ {
reload_prop_value (group, &values[i]); reload_prop_value (group, &values[i]);
++i; ++i;
} }
meta_prop_free_values (values, n_properties); meta_prop_free_values (values, n_properties);
g_free (values); g_free (values);
} }
@ -97,11 +97,11 @@ init_prop_value (MetaDisplay *display,
Atom property, Atom property,
MetaPropValue *value) MetaPropValue *value)
{ {
MetaGroupPropHooks *hooks; MetaGroupPropHooks *hooks;
value->type = META_PROP_VALUE_INVALID; value->type = META_PROP_VALUE_INVALID;
value->atom = None; value->atom = None;
hooks = find_hooks (display, property); hooks = find_hooks (display, property);
if (hooks && hooks->init_func != NULL) if (hooks && hooks->init_func != NULL)
(* hooks->init_func) (display, property, value); (* hooks->init_func) (display, property, value);
@ -111,8 +111,8 @@ static void
reload_prop_value (MetaGroup *group, reload_prop_value (MetaGroup *group,
MetaPropValue *value) MetaPropValue *value)
{ {
MetaGroupPropHooks *hooks; MetaGroupPropHooks *hooks;
hooks = find_hooks (group->display, value->atom); hooks = find_hooks (group->display, value->atom);
if (hooks && hooks->reload_func != NULL) if (hooks && hooks->reload_func != NULL)
(* hooks->reload_func) (group, value); (* hooks->reload_func) (group, value);
@ -133,7 +133,7 @@ reload_wm_client_machine (MetaGroup *group,
{ {
g_free (group->wm_client_machine); g_free (group->wm_client_machine);
group->wm_client_machine = NULL; group->wm_client_machine = NULL;
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
group->wm_client_machine = g_strdup (value->v.str); group->wm_client_machine = g_strdup (value->v.str);
@ -156,10 +156,10 @@ reload_net_startup_id (MetaGroup *group,
{ {
g_free (group->startup_id); g_free (group->startup_id);
group->startup_id = NULL; group->startup_id = NULL;
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
group->startup_id = g_strdup (value->v.str); group->startup_id = g_strdup (value->v.str);
meta_verbose ("Group has startup id \"%s\"\n", meta_verbose ("Group has startup id \"%s\"\n",
group->startup_id ? group->startup_id : "unset"); group->startup_id ? group->startup_id : "unset");
} }
@ -171,12 +171,12 @@ meta_display_init_group_prop_hooks (MetaDisplay *display)
{ {
int i; int i;
MetaGroupPropHooks *hooks; MetaGroupPropHooks *hooks;
g_assert (display->group_prop_hooks == NULL); g_assert (display->group_prop_hooks == NULL);
display->group_prop_hooks = g_new0 (MetaGroupPropHooks, N_HOOKS); display->group_prop_hooks = g_new0 (MetaGroupPropHooks, N_HOOKS);
hooks = display->group_prop_hooks; hooks = display->group_prop_hooks;
i = 0; i = 0;
hooks[i].property = display->atom_WM_CLIENT_MACHINE; hooks[i].property = display->atom_WM_CLIENT_MACHINE;
@ -193,7 +193,7 @@ meta_display_init_group_prop_hooks (MetaDisplay *display)
hooks[i].init_func = init_net_startup_id; hooks[i].init_func = init_net_startup_id;
hooks[i].reload_func = reload_net_startup_id; hooks[i].reload_func = reload_net_startup_id;
++i; ++i;
if (i != N_HOOKS) if (i != N_HOOKS)
{ {
g_error ("Initialized %d group hooks should have been %d\n", i, N_HOOKS); g_error ("Initialized %d group hooks should have been %d\n", i, N_HOOKS);
@ -204,7 +204,7 @@ void
meta_display_free_group_prop_hooks (MetaDisplay *display) meta_display_free_group_prop_hooks (MetaDisplay *display)
{ {
g_assert (display->group_prop_hooks != NULL); g_assert (display->group_prop_hooks != NULL);
g_free (display->group_prop_hooks); g_free (display->group_prop_hooks);
display->group_prop_hooks = NULL; display->group_prop_hooks = NULL;
} }
@ -218,13 +218,13 @@ find_hooks (MetaDisplay *display,
/* FIXME we could sort the array and do binary search or /* FIXME we could sort the array and do binary search or
* something * something
*/ */
i = 0; i = 0;
while (i < N_HOOKS) while (i < N_HOOKS)
{ {
if (display->group_prop_hooks[i].property == property) if (display->group_prop_hooks[i].property == property)
return &display->group_prop_hooks[i]; return &display->group_prop_hooks[i];
++i; ++i;
} }

View File

@ -2,9 +2,9 @@
/* MetaGroup property handling */ /* MetaGroup property handling */
/* /*
* Copyright (C) 2002 Red Hat, Inc. * Copyright (C) 2002 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -1,9 +1,9 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
/* /*
* Copyright (C) 2002 Red Hat Inc. * Copyright (C) 2002 Red Hat Inc.
* Copyright (C) 2003 Rob Adams * Copyright (C) 2003 Rob Adams
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -13,7 +13,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -40,16 +40,16 @@ meta_group_new (MetaDisplay *display,
#define N_INITIAL_PROPS 3 #define N_INITIAL_PROPS 3
Atom initial_props[N_INITIAL_PROPS]; Atom initial_props[N_INITIAL_PROPS];
int i; int i;
g_assert (N_INITIAL_PROPS == (int) G_N_ELEMENTS (initial_props)); g_assert (N_INITIAL_PROPS == (int) G_N_ELEMENTS (initial_props));
group = g_new0 (MetaGroup, 1); group = g_new0 (MetaGroup, 1);
group->display = display; group->display = display;
group->windows = NULL; group->windows = NULL;
group->group_leader = group_leader; group->group_leader = group_leader;
group->refcount = 1; /* owned by caller, hash table has only weak ref */ group->refcount = 1; /* owned by caller, hash table has only weak ref */
if (display->groups_by_leader == NULL) if (display->groups_by_leader == NULL)
display->groups_by_leader = g_hash_table_new (meta_unsigned_long_hash, display->groups_by_leader = g_hash_table_new (meta_unsigned_long_hash,
meta_unsigned_long_equal); meta_unsigned_long_equal);
@ -66,13 +66,13 @@ meta_group_new (MetaDisplay *display,
initial_props[i++] = display->atom__NET_WM_PID; initial_props[i++] = display->atom__NET_WM_PID;
initial_props[i++] = display->atom__NET_STARTUP_ID; initial_props[i++] = display->atom__NET_STARTUP_ID;
g_assert (N_INITIAL_PROPS == i); g_assert (N_INITIAL_PROPS == i);
meta_group_reload_properties (group, initial_props, N_INITIAL_PROPS); meta_group_reload_properties (group, initial_props, N_INITIAL_PROPS);
meta_topic (META_DEBUG_GROUPS, meta_topic (META_DEBUG_GROUPS,
"Created new group with leader 0x%lx\n", "Created new group with leader 0x%lx\n",
group->group_leader); group->group_leader);
return group; return group;
} }
@ -86,10 +86,10 @@ meta_group_unref (MetaGroup *group)
{ {
meta_topic (META_DEBUG_GROUPS, meta_topic (META_DEBUG_GROUPS,
"Destroying group with leader 0x%lx\n", "Destroying group with leader 0x%lx\n",
group->group_leader); group->group_leader);
g_assert (group->display->groups_by_leader != NULL); g_assert (group->display->groups_by_leader != NULL);
g_hash_table_remove (group->display->groups_by_leader, g_hash_table_remove (group->display->groups_by_leader,
&group->group_leader); &group->group_leader);
@ -102,7 +102,7 @@ meta_group_unref (MetaGroup *group)
g_free (group->wm_client_machine); g_free (group->wm_client_machine);
g_free (group->startup_id); g_free (group->startup_id);
g_free (group); g_free (group);
} }
} }
@ -128,9 +128,9 @@ meta_window_compute_group (MetaWindow* window)
MetaWindow *ancestor; MetaWindow *ancestor;
/* use window->xwindow if no window->xgroup_leader */ /* use window->xwindow if no window->xgroup_leader */
group = NULL; group = NULL;
/* Determine the ancestor of the window; its group setting will override the /* Determine the ancestor of the window; its group setting will override the
* normal grouping rules; see bug 328211. * normal grouping rules; see bug 328211.
*/ */
@ -147,7 +147,7 @@ meta_window_compute_group (MetaWindow* window)
group = g_hash_table_lookup (window->display->groups_by_leader, group = g_hash_table_lookup (window->display->groups_by_leader,
&window->xwindow); &window->xwindow);
} }
if (group != NULL) if (group != NULL)
{ {
window->group = group; window->group = group;
@ -164,7 +164,7 @@ meta_window_compute_group (MetaWindow* window)
else else
group = meta_group_new (window->display, group = meta_group_new (window->display,
window->xwindow); window->xwindow);
window->group = group; window->group = group;
} }
@ -184,7 +184,7 @@ remove_window_from_group (MetaWindow *window)
meta_topic (META_DEBUG_GROUPS, meta_topic (META_DEBUG_GROUPS,
"Removing %s from group with leader 0x%lx\n", "Removing %s from group with leader 0x%lx\n",
window->desc, window->group->group_leader); window->desc, window->group->group_leader);
window->group->windows = window->group->windows =
g_slist_remove (window->group->windows, g_slist_remove (window->group->windows,
window); window);
@ -217,9 +217,9 @@ meta_display_lookup_group (MetaDisplay *display,
Window group_leader) Window group_leader)
{ {
MetaGroup *group; MetaGroup *group;
group = NULL; group = NULL;
if (display->groups_by_leader) if (display->groups_by_leader)
group = g_hash_table_lookup (display->groups_by_leader, group = g_hash_table_lookup (display->groups_by_leader,
&group_leader); &group_leader);
@ -244,7 +244,7 @@ meta_group_update_layers (MetaGroup *group)
{ {
GSList *tmp; GSList *tmp;
GSList *frozen_stacks; GSList *frozen_stacks;
if (group->windows == NULL) if (group->windows == NULL)
return; return;
@ -263,7 +263,7 @@ meta_group_update_layers (MetaGroup *group)
meta_stack_update_layer (window->screen->stack, meta_stack_update_layer (window->screen->stack,
window); window);
tmp = tmp->next; tmp = tmp->next;
} }

View File

@ -471,7 +471,7 @@ try_pixmap_and_mask (MetaDisplay *display,
GDK_INTERP_BILINEAR); GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (unscaled)); g_object_unref (G_OBJECT (unscaled));
if (*iconp && *mini_iconp) if (*iconp && *mini_iconp)
return TRUE; return TRUE;
else else
@ -569,7 +569,7 @@ clear_icon_cache (MetaIconCache *icon_cache,
g_object_unref (G_OBJECT (icon_cache->mini_icon)); g_object_unref (G_OBJECT (icon_cache->mini_icon));
icon_cache->mini_icon = NULL; icon_cache->mini_icon = NULL;
#endif #endif
icon_cache->origin = USING_NO_ICON; icon_cache->origin = USING_NO_ICON;
if (dirty_all) if (dirty_all)
@ -655,13 +655,13 @@ scaled_from_pixdata (guchar *pixdata,
{ {
GdkPixbuf *src; GdkPixbuf *src;
GdkPixbuf *dest; GdkPixbuf *dest;
src = gdk_pixbuf_new_from_data (pixdata, src = gdk_pixbuf_new_from_data (pixdata,
GDK_COLORSPACE_RGB, GDK_COLORSPACE_RGB,
TRUE, TRUE,
8, 8,
w, h, w * 4, w, h, w * 4,
free_pixels, free_pixels,
NULL); NULL);
if (src == NULL) if (src == NULL)
@ -673,7 +673,7 @@ scaled_from_pixdata (guchar *pixdata,
int size; int size;
size = MAX (w, h); size = MAX (w, h);
tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, size, size); tmp = gdk_pixbuf_new (GDK_COLORSPACE_RGB, TRUE, 8, size, size);
if (tmp) if (tmp)
@ -682,16 +682,16 @@ scaled_from_pixdata (guchar *pixdata,
gdk_pixbuf_copy_area (src, 0, 0, w, h, gdk_pixbuf_copy_area (src, 0, 0, w, h,
tmp, tmp,
(size - w) / 2, (size - h) / 2); (size - w) / 2, (size - h) / 2);
g_object_unref (src); g_object_unref (src);
src = tmp; src = tmp;
} }
} }
if (w != new_w || h != new_h) if (w != new_w || h != new_h)
{ {
dest = gdk_pixbuf_scale_simple (src, new_w, new_h, GDK_INTERP_BILINEAR); dest = gdk_pixbuf_scale_simple (src, new_w, new_h, GDK_INTERP_BILINEAR);
g_object_unref (G_OBJECT (src)); g_object_unref (G_OBJECT (src));
} }
else else
@ -741,7 +741,7 @@ meta_read_icons (MetaScreen *screen,
icon_cache->ideal_mini_width = ideal_mini_width; icon_cache->ideal_mini_width = ideal_mini_width;
icon_cache->ideal_mini_height = ideal_mini_height; icon_cache->ideal_mini_height = ideal_mini_height;
#endif #endif
if (!meta_icon_cache_get_icon_invalidated (icon_cache)) if (!meta_icon_cache_get_icon_invalidated (icon_cache))
return FALSE; /* we have no new info to use */ return FALSE; /* we have no new info to use */
@ -778,7 +778,7 @@ meta_read_icons (MetaScreen *screen,
{ {
replace_cache (icon_cache, USING_NET_WM_ICON, replace_cache (icon_cache, USING_NET_WM_ICON,
*iconp, *mini_iconp); *iconp, *mini_iconp);
return TRUE; return TRUE;
} }
else else
@ -862,7 +862,7 @@ meta_read_icons (MetaScreen *screen,
replace_cache (icon_cache, USING_FALLBACK_ICON, replace_cache (icon_cache, USING_FALLBACK_ICON,
*iconp, *mini_iconp); *iconp, *mini_iconp);
return TRUE; return TRUE;
} }

View File

@ -2,9 +2,9 @@
/* Mutter window icons */ /* Mutter window icons */
/* /*
* Copyright (C) 2002 Havoc Pennington * Copyright (C) 2002 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -39,13 +39,13 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts.
All Rights Reserved All Rights Reserved
Permission to use, copy, modify, and distribute this software and its Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in both that copyright notice and this permission notice appear in
supporting documentation, and that the name of Digital not be supporting documentation, and that the name of Digital not be
used in advertising or publicity pertaining to distribution of the used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission. software without specific, written prior permission.
DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL

View File

@ -2,11 +2,11 @@
/* Mutter Session Management */ /* Mutter Session Management */
/* /*
* Copyright (C) 2001 Havoc Pennington (some code in here from * Copyright (C) 2001 Havoc Pennington (some code in here from
* libgnomeui, (C) Tom Tromey, Carsten Schaar) * libgnomeui, (C) Tom Tromey, Carsten Schaar)
* Copyright (C) 2004, 2005 Elijah Newren * Copyright (C) 2004, 2005 Elijah Newren
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -16,7 +16,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -70,7 +70,7 @@ meta_window_release_saved_state (const MetaWindowSessionInfo *info)
static void ice_io_error_handler (IceConn connection); static void ice_io_error_handler (IceConn connection);
static void new_ice_connection (IceConn connection, IcePointer client_data, static void new_ice_connection (IceConn connection, IcePointer client_data,
Bool opening, IcePointer *watch_data); Bool opening, IcePointer *watch_data);
static void save_state (void); static void save_state (void);
@ -100,7 +100,7 @@ process_ice_messages (GIOChannel *channel,
#if 0 #if 0
IcePointer context = IceGetConnectionContext (connection); IcePointer context = IceGetConnectionContext (connection);
#endif #endif
/* We were disconnected; close our connection to the /* We were disconnected; close our connection to the
* session manager, this will result in the ICE connection * session manager, this will result in the ICE connection
* being cleaned up, since it is owned by libSM. * being cleaned up, since it is owned by libSM.
@ -110,7 +110,7 @@ process_ice_messages (GIOChannel *channel,
return FALSE; return FALSE;
} }
return TRUE; return TRUE;
} }
@ -128,22 +128,22 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening,
* exec'ed children * exec'ed children
*/ */
GIOChannel *channel; GIOChannel *channel;
fcntl (IceConnectionNumber (connection), F_SETFD, fcntl (IceConnectionNumber (connection), F_SETFD,
fcntl (IceConnectionNumber (connection), F_GETFD, 0) | FD_CLOEXEC); fcntl (IceConnectionNumber (connection), F_GETFD, 0) | FD_CLOEXEC);
channel = g_io_channel_unix_new (IceConnectionNumber (connection)); channel = g_io_channel_unix_new (IceConnectionNumber (connection));
input_id = g_io_add_watch (channel, input_id = g_io_add_watch (channel,
G_IO_IN | G_IO_ERR, G_IO_IN | G_IO_ERR,
process_ice_messages, process_ice_messages,
connection); connection);
g_io_channel_unref (channel); g_io_channel_unref (channel);
*watch_data = (IcePointer) GUINT_TO_POINTER (input_id); *watch_data = (IcePointer) GUINT_TO_POINTER (input_id);
} }
else else
{ {
input_id = GPOINTER_TO_UINT ((gpointer) *watch_data); input_id = GPOINTER_TO_UINT ((gpointer) *watch_data);
@ -153,14 +153,14 @@ new_ice_connection (IceConn connection, IcePointer client_data, Bool opening,
static IceIOErrorHandler ice_installed_handler; static IceIOErrorHandler ice_installed_handler;
/* We call any handler installed before (or after) gnome_ice_init but /* We call any handler installed before (or after) gnome_ice_init but
avoid calling the default libICE handler which does an exit() */ avoid calling the default libICE handler which does an exit() */
static void static void
ice_io_error_handler (IceConn connection) ice_io_error_handler (IceConn connection)
{ {
if (ice_installed_handler) if (ice_installed_handler)
(*ice_installed_handler) (connection); (*ice_installed_handler) (connection);
} }
static void static void
ice_init (void) ice_init (void)
@ -229,7 +229,7 @@ meta_session_init (const char *previous_client_id,
unsigned long mask; unsigned long mask;
SmcCallbacks callbacks; SmcCallbacks callbacks;
char *saved_client_id; char *saved_client_id;
meta_topic (META_DEBUG_SM, "Initializing session with save file '%s'\n", meta_topic (META_DEBUG_SM, "Initializing session with save file '%s'\n",
previous_save_file ? previous_save_file : "(none)"); previous_save_file ? previous_save_file : "(none)");
@ -248,24 +248,24 @@ meta_session_init (const char *previous_client_id,
{ {
saved_client_id = NULL; saved_client_id = NULL;
} }
ice_init (); ice_init ();
mask = SmcSaveYourselfProcMask | SmcDieProcMask | mask = SmcSaveYourselfProcMask | SmcDieProcMask |
SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask; SmcSaveCompleteProcMask | SmcShutdownCancelledProcMask;
callbacks.save_yourself.callback = save_yourself_callback; callbacks.save_yourself.callback = save_yourself_callback;
callbacks.save_yourself.client_data = NULL; callbacks.save_yourself.client_data = NULL;
callbacks.die.callback = die_callback; callbacks.die.callback = die_callback;
callbacks.die.client_data = NULL; callbacks.die.client_data = NULL;
callbacks.save_complete.callback = save_complete_callback; callbacks.save_complete.callback = save_complete_callback;
callbacks.save_complete.client_data = NULL; callbacks.save_complete.client_data = NULL;
callbacks.shutdown_cancelled.callback = shutdown_cancelled_callback; callbacks.shutdown_cancelled.callback = shutdown_cancelled_callback;
callbacks.shutdown_cancelled.client_data = NULL; callbacks.shutdown_cancelled.client_data = NULL;
session_connection = session_connection =
SmcOpenConnection (NULL, /* use SESSION_MANAGER env */ SmcOpenConnection (NULL, /* use SESSION_MANAGER env */
NULL, /* means use existing ICE connection */ NULL, /* means use existing ICE connection */
@ -276,10 +276,10 @@ meta_session_init (const char *previous_client_id,
(char*) previous_client_id, (char*) previous_client_id,
&client_id, &client_id,
255, buf); 255, buf);
if (session_connection == NULL) if (session_connection == NULL)
{ {
meta_topic (META_DEBUG_SM, meta_topic (META_DEBUG_SM,
"Failed to a open connection to a session manager, so window positions will not be saved: %s\n", "Failed to a open connection to a session manager, so window positions will not be saved: %s\n",
buf); buf);
@ -296,7 +296,7 @@ meta_session_init (const char *previous_client_id,
current_state = STATE_IDLE; current_state = STATE_IDLE;
else else
current_state = STATE_REGISTERING; current_state = STATE_REGISTERING;
{ {
SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6]; SmProp prop1, prop2, prop3, prop4, prop5, prop6, *props[6];
SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val; SmPropValue prop1val, prop2val, prop3val, prop4val, prop5val, prop6val;
@ -328,7 +328,7 @@ meta_session_init (const char *previous_client_id,
prop2.vals = &prop2val; prop2.vals = &prop2val;
prop2val.value = (char*) g_get_user_name (); prop2val.value = (char*) g_get_user_name ();
prop2val.length = strlen (prop2val.value); prop2val.length = strlen (prop2val.value);
prop3.name = SmRestartStyleHint; prop3.name = SmRestartStyleHint;
prop3.type = SmCARD8; prop3.type = SmCARD8;
prop3.num_vals = 1; prop3.num_vals = 1;
@ -342,7 +342,7 @@ meta_session_init (const char *previous_client_id,
prop4.num_vals = 1; prop4.num_vals = 1;
prop4.vals = &prop4val; prop4.vals = &prop4val;
prop4val.value = pid; prop4val.value = pid;
prop4val.length = strlen (prop4val.value); prop4val.length = strlen (prop4val.value);
/* Always start in home directory */ /* Always start in home directory */
prop5.name = SmCurrentDirectory; prop5.name = SmCurrentDirectory;
@ -358,14 +358,14 @@ meta_session_init (const char *previous_client_id,
prop6.vals = &prop6val; prop6.vals = &prop6val;
prop6val.value = &priority; prop6val.value = &priority;
prop6val.length = 1; prop6val.length = 1;
props[0] = &prop1; props[0] = &prop1;
props[1] = &prop2; props[1] = &prop2;
props[2] = &prop3; props[2] = &prop3;
props[3] = &prop4; props[3] = &prop4;
props[4] = &prop5; props[4] = &prop5;
props[5] = &prop6; props[5] = &prop6;
SmcSetProperties (session_connection, 6, props); SmcSetProperties (session_connection, 6, props);
} }
@ -388,11 +388,11 @@ save_yourself_possibly_done (gboolean shutdown,
meta_topic (META_DEBUG_SM, meta_topic (META_DEBUG_SM,
"save possibly done shutdown = %d success = %d\n", "save possibly done shutdown = %d success = %d\n",
shutdown, successful); shutdown, successful);
if (current_state == STATE_SAVING_PHASE_1) if (current_state == STATE_SAVING_PHASE_1)
{ {
Status status; Status status;
status = SmcRequestSaveYourselfPhase2 (session_connection, status = SmcRequestSaveYourselfPhase2 (session_connection,
save_phase_2_callback, save_phase_2_callback,
GINT_TO_POINTER (shutdown)); GINT_TO_POINTER (shutdown));
@ -423,17 +423,17 @@ save_yourself_possibly_done (gboolean shutdown,
meta_topic (META_DEBUG_SM, meta_topic (META_DEBUG_SM,
"Requested interact, status = %d\n", status); "Requested interact, status = %d\n", status);
} }
if (current_state == STATE_SAVING_PHASE_1 || if (current_state == STATE_SAVING_PHASE_1 ||
current_state == STATE_SAVING_PHASE_2 || current_state == STATE_SAVING_PHASE_2 ||
current_state == STATE_DONE_WITH_INTERACT || current_state == STATE_DONE_WITH_INTERACT ||
current_state == STATE_SKIPPING_GLOBAL_SAVE) current_state == STATE_SKIPPING_GLOBAL_SAVE)
{ {
meta_topic (META_DEBUG_SM, "Sending SaveYourselfDone\n"); meta_topic (META_DEBUG_SM, "Sending SaveYourselfDone\n");
SmcSaveYourselfDone (session_connection, SmcSaveYourselfDone (session_connection,
successful); successful);
if (shutdown) if (shutdown)
current_state = STATE_FROZEN; current_state = STATE_FROZEN;
else else
@ -441,19 +441,19 @@ save_yourself_possibly_done (gboolean shutdown,
} }
} }
static void static void
save_phase_2_callback (SmcConn smc_conn, SmPointer client_data) save_phase_2_callback (SmcConn smc_conn, SmPointer client_data)
{ {
gboolean shutdown; gboolean shutdown;
meta_topic (META_DEBUG_SM, "Phase 2 save"); meta_topic (META_DEBUG_SM, "Phase 2 save");
shutdown = GPOINTER_TO_INT (client_data); shutdown = GPOINTER_TO_INT (client_data);
current_state = STATE_SAVING_PHASE_2; current_state = STATE_SAVING_PHASE_2;
save_state (); save_state ();
save_yourself_possibly_done (shutdown, TRUE); save_yourself_possibly_done (shutdown, TRUE);
} }
@ -468,9 +468,9 @@ save_yourself_callback (SmcConn smc_conn,
gboolean successful; gboolean successful;
meta_topic (META_DEBUG_SM, "SaveYourself received"); meta_topic (META_DEBUG_SM, "SaveYourself received");
successful = TRUE; successful = TRUE;
/* The first SaveYourself after registering for the first time /* The first SaveYourself after registering for the first time
* is a special case (SM specs 7.2). * is a special case (SM specs 7.2).
*/ */
@ -480,8 +480,8 @@ save_yourself_callback (SmcConn smc_conn,
{ {
current_state = STATE_IDLE; current_state = STATE_IDLE;
/* Double check that this is a section 7.2 SaveYourself: */ /* Double check that this is a section 7.2 SaveYourself: */
if (save_style == SmSaveLocal && if (save_style == SmSaveLocal &&
interact_style == SmInteractStyleNone && interact_style == SmInteractStyleNone &&
!shutdown && !fast) !shutdown && !fast)
{ {
@ -493,7 +493,7 @@ save_yourself_callback (SmcConn smc_conn,
#endif #endif
/* ignore Global style saves /* ignore Global style saves
* *
* This interpretaion of the Local/Global/Both styles * This interpretaion of the Local/Global/Both styles
* was discussed extensively on the xdg-list. See: * was discussed extensively on the xdg-list. See:
* *
@ -507,11 +507,11 @@ save_yourself_callback (SmcConn smc_conn,
} }
interaction_allowed = interact_style != SmInteractStyleNone; interaction_allowed = interact_style != SmInteractStyleNone;
current_state = STATE_SAVING_PHASE_1; current_state = STATE_SAVING_PHASE_1;
regenerate_save_file (); regenerate_save_file ();
set_clone_restart_commands (); set_clone_restart_commands ();
save_yourself_possibly_done (shutdown, successful); save_yourself_possibly_done (shutdown, successful);
@ -550,7 +550,7 @@ static void
shutdown_cancelled_callback (SmcConn smc_conn, SmPointer client_data) shutdown_cancelled_callback (SmcConn smc_conn, SmPointer client_data)
{ {
meta_topic (META_DEBUG_SM, "Shutdown cancelled received\n"); meta_topic (META_DEBUG_SM, "Shutdown cancelled received\n");
if (session_connection != NULL && if (session_connection != NULL &&
(current_state != STATE_IDLE && current_state != STATE_FROZEN)) (current_state != STATE_IDLE && current_state != STATE_FROZEN))
{ {
@ -559,14 +559,14 @@ shutdown_cancelled_callback (SmcConn smc_conn, SmPointer client_data)
} }
} }
static void static void
interact_callback (SmcConn smc_conn, SmPointer client_data) interact_callback (SmcConn smc_conn, SmPointer client_data)
{ {
/* nothing */ /* nothing */
gboolean shutdown; gboolean shutdown;
meta_topic (META_DEBUG_SM, "Interaction permission received\n"); meta_topic (META_DEBUG_SM, "Interaction permission received\n");
shutdown = GPOINTER_TO_INT (client_data); shutdown = GPOINTER_TO_INT (client_data);
current_state = STATE_DONE_WITH_INTERACT; current_state = STATE_DONE_WITH_INTERACT;
@ -585,14 +585,14 @@ set_clone_restart_commands (void)
const char *prgname; const char *prgname;
prgname = g_get_prgname (); prgname = g_get_prgname ();
/* Restart (use same client ID) */ /* Restart (use same client ID) */
prop1.name = SmRestartCommand; prop1.name = SmRestartCommand;
prop1.type = SmLISTofARRAY8; prop1.type = SmLISTofARRAY8;
g_return_if_fail (client_id); g_return_if_fail (client_id);
i = 0; i = 0;
restartv[i] = (char *)prgname; restartv[i] = (char *)prgname;
++i; ++i;
@ -613,7 +613,7 @@ set_clone_restart_commands (void)
prop1.num_vals = i; prop1.num_vals = i;
/* Clone (no client ID) */ /* Clone (no client ID) */
i = 0; i = 0;
clonev[i] = (char *)prgname; clonev[i] = (char *)prgname;
++i; ++i;
@ -621,7 +621,7 @@ set_clone_restart_commands (void)
prop2.name = SmCloneCommand; prop2.name = SmCloneCommand;
prop2.type = SmLISTofARRAY8; prop2.type = SmLISTofARRAY8;
prop2.vals = g_new (SmPropValue, i); prop2.vals = g_new (SmPropValue, i);
i = 0; i = 0;
while (clonev[i]) while (clonev[i])
@ -633,7 +633,7 @@ set_clone_restart_commands (void)
prop2.num_vals = i; prop2.num_vals = i;
/* Discard */ /* Discard */
i = 0; i = 0;
discardv[i] = "rm"; discardv[i] = "rm";
++i; ++i;
@ -642,10 +642,10 @@ set_clone_restart_commands (void)
discardv[i] = (char*) full_save_file (); discardv[i] = (char*) full_save_file ();
++i; ++i;
discardv[i] = NULL; discardv[i] = NULL;
prop3.name = SmDiscardCommand; prop3.name = SmDiscardCommand;
prop3.type = SmLISTofARRAY8; prop3.type = SmLISTofARRAY8;
prop3.vals = g_new (SmPropValue, i); prop3.vals = g_new (SmPropValue, i);
i = 0; i = 0;
while (discardv[i]) while (discardv[i])
@ -656,11 +656,11 @@ set_clone_restart_commands (void)
} }
prop3.num_vals = i; prop3.num_vals = i;
props[0] = &prop1; props[0] = &prop1;
props[1] = &prop2; props[1] = &prop2;
props[2] = &prop3; props[2] = &prop3;
SmcSetProperties (session_connection, 3, props); SmcSetProperties (session_connection, 3, props);
g_free (prop1.vals); g_free (prop1.vals);
@ -713,7 +713,7 @@ window_type_to_string (MetaWindowType type)
} }
return ""; return "";
} }
static MetaWindowType static MetaWindowType
window_type_from_string (const char *str) window_type_from_string (const char *str)
@ -776,7 +776,7 @@ encode_text_as_utf8_markup (const char *text)
GString *str; GString *str;
const char *p; const char *p;
char *escaped; char *escaped;
str = g_string_new (""); str = g_string_new ("");
p = text; p = text;
@ -788,7 +788,7 @@ encode_text_as_utf8_markup (const char *text)
escaped = g_markup_escape_text (str->str, str->len); escaped = g_markup_escape_text (str->str, str->len);
g_string_free (str, TRUE); g_string_free (str, TRUE);
return escaped; return escaped;
} }
@ -800,7 +800,7 @@ decode_text_from_utf8 (const char *text)
const char *p; const char *p;
str = g_string_new (""); str = g_string_new ("");
p = text; p = text;
while (*p) while (*p)
{ {
@ -822,11 +822,11 @@ save_state (void)
GSList *windows; GSList *windows;
GSList *tmp; GSList *tmp;
int stack_position; int stack_position;
g_assert (client_id); g_assert (client_id);
outfile = NULL; outfile = NULL;
/* /*
* g_get_user_config_dir() is guaranteed to return an existing directory. * g_get_user_config_dir() is guaranteed to return an existing directory.
* Eventually, if SM stays with the WM, I'd like to make this * Eventually, if SM stays with the WM, I'd like to make this
@ -838,7 +838,7 @@ save_state (void)
mutter_dir = g_strconcat (g_get_user_config_dir (), mutter_dir = g_strconcat (g_get_user_config_dir (),
G_DIR_SEPARATOR_S "mutter", G_DIR_SEPARATOR_S "mutter",
NULL); NULL);
session_dir = g_strconcat (mutter_dir, session_dir = g_strconcat (mutter_dir,
G_DIR_SEPARATOR_S "sessions", G_DIR_SEPARATOR_S "sessions",
NULL); NULL);
@ -858,7 +858,7 @@ save_state (void)
} }
meta_topic (META_DEBUG_SM, "Saving session to '%s'\n", full_save_file ()); meta_topic (META_DEBUG_SM, "Saving session to '%s'\n", full_save_file ());
outfile = fopen (full_save_file (), "w"); outfile = fopen (full_save_file (), "w");
if (outfile == NULL) if (outfile == NULL)
@ -881,9 +881,9 @@ save_state (void)
* Note that attributes on <window> are the match info we use to * Note that attributes on <window> are the match info we use to
* see if the saved state applies to a restored window, and * see if the saved state applies to a restored window, and
* child elements are the saved state to be applied. * child elements are the saved state to be applied.
* *
*/ */
fprintf (outfile, "<mutter_session id=\"%s\">\n", fprintf (outfile, "<mutter_session id=\"%s\">\n",
client_id); client_id);
@ -912,7 +912,7 @@ save_state (void)
* in UTF-8 (I think they are in XPCS which is Latin-1? * in UTF-8 (I think they are in XPCS which is Latin-1?
* in practice they are always ascii though.) * in practice they are always ascii though.)
*/ */
sm_client_id = encode_text_as_utf8_markup (window->sm_client_id); sm_client_id = encode_text_as_utf8_markup (window->sm_client_id);
res_class = window->res_class ? res_class = window->res_class ?
encode_text_as_utf8_markup (window->res_class) : NULL; encode_text_as_utf8_markup (window->res_class) : NULL;
@ -924,7 +924,7 @@ save_state (void)
title = g_markup_escape_text (window->title, -1); title = g_markup_escape_text (window->title, -1);
else else
title = NULL; title = NULL;
meta_topic (META_DEBUG_SM, "Saving session managed window %s, client ID '%s'\n", meta_topic (META_DEBUG_SM, "Saving session managed window %s, client ID '%s'\n",
window->desc, window->sm_client_id); window->desc, window->sm_client_id);
@ -943,7 +943,7 @@ save_state (void)
g_free (res_name); g_free (res_name);
g_free (role); g_free (role);
g_free (title); g_free (title);
/* Sticky */ /* Sticky */
if (window->on_all_workspaces_requested) if (window->on_all_workspaces_requested)
fputs (" <sticky/>\n", outfile); fputs (" <sticky/>\n", outfile);
@ -956,13 +956,13 @@ save_state (void)
if (META_WINDOW_MAXIMIZED (window)) if (META_WINDOW_MAXIMIZED (window))
{ {
fprintf (outfile, fprintf (outfile,
" <maximized saved_x=\"%d\" saved_y=\"%d\" saved_width=\"%d\" saved_height=\"%d\"/>\n", " <maximized saved_x=\"%d\" saved_y=\"%d\" saved_width=\"%d\" saved_height=\"%d\"/>\n",
window->saved_rect.x, window->saved_rect.x,
window->saved_rect.y, window->saved_rect.y,
window->saved_rect.width, window->saved_rect.width,
window->saved_rect.height); window->saved_rect.height);
} }
/* Workspaces we're on */ /* Workspaces we're on */
{ {
int n; int n;
@ -975,13 +975,13 @@ save_state (void)
{ {
int x, y, w, h; int x, y, w, h;
meta_window_get_geometry (window, &x, &y, &w, &h); meta_window_get_geometry (window, &x, &y, &w, &h);
fprintf (outfile, fprintf (outfile,
" <geometry x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" gravity=\"%s\"/>\n", " <geometry x=\"%d\" y=\"%d\" width=\"%d\" height=\"%d\" gravity=\"%s\"/>\n",
x, y, w, h, x, y, w, h,
meta_gravity_to_string (window->size_hints.win_gravity)); meta_gravity_to_string (window->size_hints.win_gravity));
} }
fputs (" </window>\n", outfile); fputs (" </window>\n", outfile);
} }
else else
@ -989,15 +989,15 @@ save_state (void)
meta_topic (META_DEBUG_SM, "Not saving window '%s', not session managed\n", meta_topic (META_DEBUG_SM, "Not saving window '%s', not session managed\n",
window->desc); window->desc);
} }
tmp = tmp->next; tmp = tmp->next;
++stack_position; ++stack_position;
} }
g_slist_free (windows); g_slist_free (windows);
fputs ("</mutter_session>\n", outfile); fputs ("</mutter_session>\n", outfile);
out: out:
if (outfile) if (outfile)
{ {
@ -1013,7 +1013,7 @@ save_state (void)
full_save_file (), g_strerror (errno)); full_save_file (), g_strerror (errno));
} }
} }
g_free (mutter_dir); g_free (mutter_dir);
g_free (session_dir); g_free (session_dir);
} }
@ -1094,7 +1094,7 @@ load_state (const char *previous_save_file)
G_DIR_SEPARATOR_S, G_DIR_SEPARATOR_S,
previous_save_file, previous_save_file,
NULL); NULL);
if (!g_file_get_contents (session_file, if (!g_file_get_contents (session_file,
&text, &text,
&length, &length,
@ -1114,10 +1114,10 @@ load_state (const char *previous_save_file)
meta_topic (META_DEBUG_SM, "Parsing saved session file %s\n", session_file); meta_topic (META_DEBUG_SM, "Parsing saved session file %s\n", session_file);
g_free (session_file); g_free (session_file);
session_file = NULL; session_file = NULL;
parse_data.info = NULL; parse_data.info = NULL;
parse_data.previous_id = NULL; parse_data.previous_id = NULL;
context = g_markup_parse_context_new (&mutter_session_parser, context = g_markup_parse_context_new (&mutter_session_parser,
0, &parse_data, NULL); 0, &parse_data, NULL);
@ -1127,8 +1127,8 @@ load_state (const char *previous_save_file)
length, length,
&error)) &error))
goto error; goto error;
error = NULL; error = NULL;
if (!g_markup_parse_context_end_parse (context, &error)) if (!g_markup_parse_context_end_parse (context, &error))
goto error; goto error;
@ -1138,7 +1138,7 @@ load_state (const char *previous_save_file)
goto out; goto out;
error: error:
meta_warning ("Failed to parse saved session file: %s\n", meta_warning ("Failed to parse saved session file: %s\n",
error->message); error->message);
g_error_free (error); g_error_free (error);
@ -1148,9 +1148,9 @@ load_state (const char *previous_save_file)
g_free (parse_data.previous_id); g_free (parse_data.previous_id);
parse_data.previous_id = NULL; parse_data.previous_id = NULL;
out: out:
g_free (text); g_free (text);
return parse_data.previous_id; return parse_data.previous_id;
@ -1172,14 +1172,14 @@ start_element_handler (GMarkupParseContext *context,
if (strcmp (element_name, "mutter_session") == 0) if (strcmp (element_name, "mutter_session") == 0)
{ {
/* Get previous ID */ /* Get previous ID */
int i; int i;
i = 0; i = 0;
while (attribute_names[i]) while (attribute_names[i])
{ {
const char *name; const char *name;
const char *val; const char *val;
name = attribute_names[i]; name = attribute_names[i];
val = attribute_values[i]; val = attribute_values[i];
@ -1191,7 +1191,7 @@ start_element_handler (GMarkupParseContext *context,
"<mutter_session> attribute seen but we already have the session ID"); "<mutter_session> attribute seen but we already have the session ID");
return; return;
} }
if (strcmp (name, "id") == 0) if (strcmp (name, "id") == 0)
{ {
pd->previous_id = decode_text_from_utf8 (val); pd->previous_id = decode_text_from_utf8 (val);
@ -1205,14 +1205,14 @@ start_element_handler (GMarkupParseContext *context,
name, "mutter_session"); name, "mutter_session");
return; return;
} }
++i; ++i;
} }
} }
else if (strcmp (element_name, "window") == 0) else if (strcmp (element_name, "window") == 0)
{ {
int i; int i;
if (pd->info) if (pd->info)
{ {
g_set_error (error, g_set_error (error,
@ -1221,7 +1221,7 @@ start_element_handler (GMarkupParseContext *context,
"nested <window> tag"); "nested <window> tag");
return; return;
} }
pd->info = session_info_new (); pd->info = session_info_new ();
i = 0; i = 0;
@ -1229,10 +1229,10 @@ start_element_handler (GMarkupParseContext *context,
{ {
const char *name; const char *name;
const char *val; const char *val;
name = attribute_names[i]; name = attribute_names[i];
val = attribute_values[i]; val = attribute_values[i];
if (strcmp (name, "id") == 0) if (strcmp (name, "id") == 0)
{ {
if (*val) if (*val)
@ -1282,7 +1282,7 @@ start_element_handler (GMarkupParseContext *context,
pd->info = NULL; pd->info = NULL;
return; return;
} }
++i; ++i;
} }
} }
@ -1296,7 +1296,7 @@ start_element_handler (GMarkupParseContext *context,
const char *name; const char *name;
name = attribute_names[i]; name = attribute_names[i];
if (strcmp (name, "index") == 0) if (strcmp (name, "index") == 0)
{ {
pd->info->workspace_indices = pd->info->workspace_indices =
@ -1314,7 +1314,7 @@ start_element_handler (GMarkupParseContext *context,
pd->info = NULL; pd->info = NULL;
return; return;
} }
++i; ++i;
} }
} }
@ -1394,22 +1394,22 @@ start_element_handler (GMarkupParseContext *context,
pd->info->saved_rect.y, pd->info->saved_rect.y,
pd->info->saved_rect.width, pd->info->saved_rect.width,
pd->info->saved_rect.height); pd->info->saved_rect.height);
} }
else if (strcmp (element_name, "geometry") == 0) else if (strcmp (element_name, "geometry") == 0)
{ {
int i; int i;
pd->info->geometry_set = TRUE; pd->info->geometry_set = TRUE;
i = 0; i = 0;
while (attribute_names[i]) while (attribute_names[i])
{ {
const char *name; const char *name;
const char *val; const char *val;
name = attribute_names[i]; name = attribute_names[i];
val = attribute_values[i]; val = attribute_values[i];
if (strcmp (name, "x") == 0) if (strcmp (name, "x") == 0)
{ {
if (*val) if (*val)
@ -1444,7 +1444,7 @@ start_element_handler (GMarkupParseContext *context,
name, "geometry"); name, "geometry");
return; return;
} }
++i; ++i;
} }
@ -1482,12 +1482,12 @@ end_element_handler (GMarkupParseContext *context,
window_info_list = g_slist_prepend (window_info_list, window_info_list = g_slist_prepend (window_info_list,
pd->info); pd->info);
meta_topic (META_DEBUG_SM, "Loaded window info from session with class: %s name: %s role: %s\n", meta_topic (META_DEBUG_SM, "Loaded window info from session with class: %s name: %s role: %s\n",
pd->info->res_class ? pd->info->res_class : "(none)", pd->info->res_class ? pd->info->res_class : "(none)",
pd->info->res_name ? pd->info->res_name : "(none)", pd->info->res_name ? pd->info->res_name : "(none)",
pd->info->role ? pd->info->role : "(none)"); pd->info->role ? pd->info->role : "(none)");
pd->info = NULL; pd->info = NULL;
} }
} }
@ -1523,20 +1523,20 @@ get_possible_matches (MetaWindow *window)
GSList *retval; GSList *retval;
GSList *tmp; GSList *tmp;
gboolean ignore_client_id; gboolean ignore_client_id;
retval = NULL; retval = NULL;
ignore_client_id = g_getenv ("MUTTER_DEBUG_SM") != NULL; ignore_client_id = g_getenv ("MUTTER_DEBUG_SM") != NULL;
tmp = window_info_list; tmp = window_info_list;
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindowSessionInfo *info; MetaWindowSessionInfo *info;
info = tmp->data; info = tmp->data;
if ((ignore_client_id || if ((ignore_client_id ||
both_null_or_matching (info->id, window->sm_client_id)) && both_null_or_matching (info->id, window->sm_client_id)) &&
both_null_or_matching (info->res_class, window->res_class) && both_null_or_matching (info->res_class, window->res_class) &&
both_null_or_matching (info->res_name, window->res_name) && both_null_or_matching (info->res_name, window->res_name) &&
both_null_or_matching (info->role, window->role)) both_null_or_matching (info->role, window->role))
@ -1563,7 +1563,7 @@ get_possible_matches (MetaWindow *window)
window->desc, window->desc,
window->res_class ? window->res_class : "(none)", window->res_class ? window->res_class : "(none)",
info->res_class ? info->res_class : "(none)"); info->res_class ? info->res_class : "(none)");
else if (!both_null_or_matching (info->res_name, window->res_name)) else if (!both_null_or_matching (info->res_name, window->res_name))
meta_topic (META_DEBUG_SM, "Window %s has name %s doesn't match saved name %s, no match\n", meta_topic (META_DEBUG_SM, "Window %s has name %s doesn't match saved name %s, no match\n",
window->desc, window->desc,
@ -1579,7 +1579,7 @@ get_possible_matches (MetaWindow *window)
window->desc, info->id); window->desc, info->id);
} }
} }
tmp = tmp->next; tmp = tmp->next;
} }
@ -1593,10 +1593,10 @@ find_best_match (GSList *infos,
GSList *tmp; GSList *tmp;
const MetaWindowSessionInfo *matching_title; const MetaWindowSessionInfo *matching_title;
const MetaWindowSessionInfo *matching_type; const MetaWindowSessionInfo *matching_type;
matching_title = NULL; matching_title = NULL;
matching_type = NULL; matching_type = NULL;
tmp = infos; tmp = infos;
while (tmp != NULL) while (tmp != NULL)
{ {
@ -1611,7 +1611,7 @@ find_best_match (GSList *infos,
if (matching_type == NULL && if (matching_type == NULL &&
info->type == window->type) info->type == window->type)
matching_type = info; matching_type = info;
tmp = tmp->next; tmp = tmp->next;
} }
@ -1620,7 +1620,7 @@ find_best_match (GSList *infos,
* to e.g. break ties by geometry hint similarity, * to e.g. break ties by geometry hint similarity,
* or other window features. * or other window features.
*/ */
if (matching_title) if (matching_title)
return matching_title; return matching_title;
else if (matching_type) else if (matching_type)
@ -1634,7 +1634,7 @@ meta_window_lookup_saved_state (MetaWindow *window)
{ {
GSList *possibles; GSList *possibles;
const MetaWindowSessionInfo *info; const MetaWindowSessionInfo *info;
/* Window is not session managed. /* Window is not session managed.
* I haven't yet figured out how to deal with these * I haven't yet figured out how to deal with these
* in a way that doesn't cause broken side effects in * in a way that doesn't cause broken side effects in
@ -1658,9 +1658,9 @@ meta_window_lookup_saved_state (MetaWindow *window)
} }
info = find_best_match (possibles, window); info = find_best_match (possibles, window);
g_slist_free (possibles); g_slist_free (possibles);
return info; return info;
} }
@ -1685,7 +1685,7 @@ session_info_free (MetaWindowSessionInfo *info)
g_free (info->role); g_free (info->role);
g_slist_free (info->workspace_indices); g_slist_free (info->workspace_indices);
g_free (info); g_free (info);
} }
@ -1698,7 +1698,7 @@ session_info_new (void)
info->type = META_WINDOW_NORMAL; info->type = META_WINDOW_NORMAL;
info->gravity = NorthWestGravity; info->gravity = NorthWestGravity;
return info; return info;
} }
@ -1739,7 +1739,7 @@ finish_interact (gboolean shutdown)
if (current_state == STATE_DONE_WITH_INTERACT) /* paranoia */ if (current_state == STATE_DONE_WITH_INTERACT) /* paranoia */
{ {
SmcInteractDone (session_connection, False /* don't cancel logout */); SmcInteractDone (session_connection, False /* don't cancel logout */);
save_yourself_possibly_done (shutdown, TRUE); save_yourself_possibly_done (shutdown, TRUE);
} }
} }
@ -1764,13 +1764,13 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
GSList *tmp; GSList *tmp;
GSList *columns = NULL; GSList *columns = NULL;
GPid pid; GPid pid;
windows = meta_display_list_windows (meta_get_display (), META_LIST_DEFAULT); windows = meta_display_list_windows (meta_get_display (), META_LIST_DEFAULT);
tmp = windows; tmp = windows;
while (tmp != NULL) while (tmp != NULL)
{ {
MetaWindow *window; MetaWindow *window;
window = tmp->data; window = tmp->data;
/* only complain about normal windows, the others /* only complain about normal windows, the others
@ -1779,12 +1779,12 @@ warn_about_lame_clients_and_finish_interact (gboolean shutdown)
if (window->sm_client_id == NULL && if (window->sm_client_id == NULL &&
window->type == META_WINDOW_NORMAL) window->type == META_WINDOW_NORMAL)
lame = g_slist_prepend (lame, window); lame = g_slist_prepend (lame, window);
tmp = tmp->next; tmp = tmp->next;
} }
g_slist_free (windows); g_slist_free (windows);
if (lame == NULL) if (lame == NULL)
{ {
/* No lame apps. */ /* No lame apps. */

View File

@ -9,9 +9,9 @@
* requires us to do it here. * requires us to do it here.
*/ */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -21,7 +21,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -45,11 +45,11 @@ struct _MetaWindowSessionInfo
MetaWindowType type; MetaWindowType type;
/* Information we restore */ /* Information we restore */
GSList *workspace_indices; GSList *workspace_indices;
int stack_position; int stack_position;
/* width/height should be multiplied by resize inc and /* width/height should be multiplied by resize inc and
* added to base size; position should be interpreted in * added to base size; position should be interpreted in
* light of gravity. This preserves semantics of the * light of gravity. This preserves semantics of the

View File

@ -94,14 +94,14 @@ x_error_handler (Display *xdisplay,
if (error_trap_depth == 0) if (error_trap_depth == 0)
{ {
print_backtrace (); print_backtrace ();
fprintf (stderr, "Unexpected X error: %s serial %ld error_code %d request_code %d minor_code %d)\n", fprintf (stderr, "Unexpected X error: %s serial %ld error_code %d request_code %d minor_code %d)\n",
buf, buf,
error->serial, error->serial,
error->error_code, error->error_code,
error->request_code, error->request_code,
error->minor_code); error->minor_code);
exit (1); exit (1);
} }
@ -122,7 +122,7 @@ error_trap_pop (Display *xdisplay)
fprintf (stderr, "Error trap underflow!\n"); fprintf (stderr, "Error trap underflow!\n");
exit (1); exit (1);
} }
XSync (xdisplay, False); /* get all errors out of the queue */ XSync (xdisplay, False); /* get all errors out of the queue */
--error_trap_depth; --error_trap_depth;
} }
@ -192,11 +192,11 @@ try_get_reply (Display *xdisplay,
struct timeval current_time; struct timeval current_time;
gettimeofday (&current_time, NULL); gettimeofday (&current_time, NULL);
printf (" %gms (we have a reply for property %ld)\n", printf (" %gms (we have a reply for property %ld)\n",
ELAPSED (program_start_time, current_time), ELAPSED (program_start_time, current_time),
ag_task_get_property (task)); ag_task_get_property (task));
data = NULL; data = NULL;
name = atom_name (xdisplay, name = atom_name (xdisplay,
@ -204,7 +204,7 @@ try_get_reply (Display *xdisplay,
printf (" %s on 0x%lx:\n", name, printf (" %s on 0x%lx:\n", name,
ag_task_get_window (task)); ag_task_get_window (task));
free (name); free (name);
result = ag_task_get_reply_and_free (task, result = ag_task_get_reply_and_free (task,
&actual_type, &actual_type,
&actual_format, &actual_format,
@ -222,12 +222,12 @@ try_get_reply (Display *xdisplay,
name = atom_name (xdisplay, actual_type); name = atom_name (xdisplay, actual_type);
printf (" actual_type = %s\n", name); printf (" actual_type = %s\n", name);
free (name); free (name);
printf (" actual_format = %d\n", actual_format); printf (" actual_format = %d\n", actual_format);
printf (" n_items = %lu\n", n_items); printf (" n_items = %lu\n", n_items);
printf (" bytes_after = %lu\n", bytes_after); printf (" bytes_after = %lu\n", bytes_after);
printf (" data = \"%s\"\n", data ? (char*) data : "NULL"); printf (" data = \"%s\"\n", data ? (char*) data : "NULL");
} }
@ -252,13 +252,13 @@ main (int argc, char **argv)
char *end; char *end;
Atom *props; Atom *props;
struct timeval current_time; struct timeval current_time;
if (argc < 2) if (argc < 2)
{ {
fprintf (stderr, "specify window ID\n"); fprintf (stderr, "specify window ID\n");
return 1; return 1;
} }
window_str = argv[1]; window_str = argv[1];
end = NULL; end = NULL;
@ -280,7 +280,7 @@ main (int argc, char **argv)
XSynchronize (xdisplay, True); XSynchronize (xdisplay, True);
XSetErrorHandler (x_error_handler); XSetErrorHandler (x_error_handler);
n_props = 0; n_props = 0;
props = XListProperties (xdisplay, window, &n_props); props = XListProperties (xdisplay, window, &n_props);
if (n_props == 0 || props == NULL) if (n_props == 0 || props == NULL)
@ -290,7 +290,7 @@ main (int argc, char **argv)
} }
gettimeofday (&program_start_time, NULL); gettimeofday (&program_start_time, NULL);
i = 0; i = 0;
while (i < n_props) while (i < n_props)
{ {
@ -307,7 +307,7 @@ main (int argc, char **argv)
fprintf (stderr, "Failed to send request\n"); fprintf (stderr, "Failed to send request\n");
return 1; return 1;
} }
++i; ++i;
} }
@ -315,24 +315,24 @@ main (int argc, char **argv)
props = NULL; props = NULL;
n_left = n_props; n_left = n_props;
while (TRUE) while (TRUE)
{ {
XEvent xevent; XEvent xevent;
int connection; int connection;
fd_set set; fd_set set;
AgGetPropertyTask *task; AgGetPropertyTask *task;
/* Mop up event queue */ /* Mop up event queue */
while (XPending (xdisplay) > 0) while (XPending (xdisplay) > 0)
{ {
XNextEvent (xdisplay, &xevent); XNextEvent (xdisplay, &xevent);
gettimeofday (&current_time, NULL); gettimeofday (&current_time, NULL);
printf (" %gms (processing event type %d)\n", printf (" %gms (processing event type %d)\n",
ELAPSED (program_start_time, current_time), ELAPSED (program_start_time, current_time),
xevent.xany.type); xevent.xany.type);
} }
while ((task = ag_get_next_completed_task (xdisplay))) while ((task = ag_get_next_completed_task (xdisplay)))
{ {
try_get_reply (xdisplay, task); try_get_reply (xdisplay, task);
@ -358,7 +358,7 @@ main (int argc, char **argv)
} }
run_speed_comparison (xdisplay, window); run_speed_comparison (xdisplay, window);
return 0; return 0;
} }
@ -373,7 +373,7 @@ run_speed_comparison (Display *xdisplay,
int n_props; int n_props;
struct timeval start, end; struct timeval start, end;
int n_left; int n_left;
/* We just use atom values (0 to n_props) % 200, many are probably /* We just use atom values (0 to n_props) % 200, many are probably
* BadAtom, that's fine, but the %200 keeps most of them valid. The * BadAtom, that's fine, but the %200 keeps most of them valid. The
* async case is about twice as advantageous when using valid atoms * async case is about twice as advantageous when using valid atoms
@ -382,9 +382,9 @@ run_speed_comparison (Display *xdisplay,
*/ */
n_props = 4000; n_props = 4000;
printf ("Timing with %d property requests\n", n_props); printf ("Timing with %d property requests\n", n_props);
gettimeofday (&start, NULL); gettimeofday (&start, NULL);
i = 0; i = 0;
while (i < n_props) while (i < n_props)
{ {
@ -397,23 +397,23 @@ run_speed_comparison (Display *xdisplay,
fprintf (stderr, "Failed to send request\n"); fprintf (stderr, "Failed to send request\n");
exit (1); exit (1);
} }
++i; ++i;
} }
n_left = n_props; n_left = n_props;
while (TRUE) while (TRUE)
{ {
int connection; int connection;
fd_set set; fd_set set;
XEvent xevent; XEvent xevent;
AgGetPropertyTask *task; AgGetPropertyTask *task;
/* Mop up event queue */ /* Mop up event queue */
while (XPending (xdisplay) > 0) while (XPending (xdisplay) > 0)
XNextEvent (xdisplay, &xevent); XNextEvent (xdisplay, &xevent);
while ((task = ag_get_next_completed_task (xdisplay))) while ((task = ag_get_next_completed_task (xdisplay)))
{ {
Atom actual_type; Atom actual_type;
@ -423,7 +423,7 @@ run_speed_comparison (Display *xdisplay,
unsigned char *data; unsigned char *data;
assert (ag_task_have_reply (task)); assert (ag_task_have_reply (task));
data = NULL; data = NULL;
ag_task_get_reply_and_free (task, ag_task_get_reply_and_free (task,
&actual_type, &actual_type,
@ -431,13 +431,13 @@ run_speed_comparison (Display *xdisplay,
&n_items, &n_items,
&bytes_after, &bytes_after,
&data); &data);
if (data) if (data)
XFree (data); XFree (data);
n_left -= 1; n_left -= 1;
} }
if (n_left == 0) if (n_left == 0)
break; break;
@ -449,16 +449,16 @@ run_speed_comparison (Display *xdisplay,
select (connection + 1, &set, NULL, NULL, NULL); select (connection + 1, &set, NULL, NULL, NULL);
} }
gettimeofday (&end, NULL); gettimeofday (&end, NULL);
printf ("Async time: %gms\n", printf ("Async time: %gms\n",
ELAPSED (start, end)); ELAPSED (start, end));
gettimeofday (&start, NULL); gettimeofday (&start, NULL);
error_trap_push (xdisplay); error_trap_push (xdisplay);
i = 0; i = 0;
while (i < n_props) while (i < n_props)
{ {
@ -467,7 +467,7 @@ run_speed_comparison (Display *xdisplay,
unsigned long n_items; unsigned long n_items;
unsigned long bytes_after; unsigned long bytes_after;
unsigned char *data; unsigned char *data;
data = NULL; data = NULL;
if (XGetWindowProperty (xdisplay, window, if (XGetWindowProperty (xdisplay, window,
(Atom) i % 200, (Atom) i % 200,
@ -483,14 +483,14 @@ run_speed_comparison (Display *xdisplay,
if (data) if (data)
XFree (data); XFree (data);
} }
++i; ++i;
} }
error_trap_pop (xdisplay); error_trap_pop (xdisplay);
gettimeofday (&end, NULL); gettimeofday (&end, NULL);
printf ("Sync time: %gms\n", printf ("Sync time: %gms\n",
ELAPSED (start, end)); ELAPSED (start, end));
} }

View File

@ -15,11 +15,11 @@
* together. * together.
*/ */
/* /*
* Copyright (C) 2001, 2002, 2003 Red Hat, Inc. * Copyright (C) 2001, 2002, 2003 Red Hat, Inc.
* Copyright (C) 2004, 2005 Elijah Newren * Copyright (C) 2004, 2005 Elijah Newren
* Copyright (C) 2009 Thomas Thurman * Copyright (C) 2009 Thomas Thurman
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -29,7 +29,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -196,7 +196,7 @@ reload_wm_client_machine (MetaWindow *window,
{ {
g_free (window->wm_client_machine); g_free (window->wm_client_machine);
window->wm_client_machine = NULL; window->wm_client_machine = NULL;
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
window->wm_client_machine = g_strdup (value->v.str); window->wm_client_machine = g_strdup (value->v.str);
@ -345,7 +345,7 @@ reload_net_wm_pid (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
gulong cardinal = (int) value->v.cardinal; gulong cardinal = (int) value->v.cardinal;
if (cardinal <= 0) if (cardinal <= 0)
meta_warning ("Application set a bogus _NET_WM_PID %lu\n", meta_warning ("Application set a bogus _NET_WM_PID %lu\n",
cardinal); cardinal);
@ -445,12 +445,12 @@ set_title_text (MetaWindow *window,
char **target) char **target)
{ {
gboolean modified = FALSE; gboolean modified = FALSE;
if (!target) if (!target)
return FALSE; return FALSE;
g_free (*target); g_free (*target);
if (!title) if (!title)
*target = g_strdup (""); *target = g_strdup ("");
else if (g_utf8_strlen (title, MAX_TITLE_LENGTH + 1) > MAX_TITLE_LENGTH) else if (g_utf8_strlen (title, MAX_TITLE_LENGTH + 1) > MAX_TITLE_LENGTH)
@ -503,7 +503,7 @@ set_window_title (MetaWindow *window,
window->display->atom__NET_WM_VISIBLE_NAME, window->display->atom__NET_WM_VISIBLE_NAME,
&new_title); &new_title);
priv->using_net_wm_visible_name = modified; priv->using_net_wm_visible_name = modified;
meta_window_set_title (window, new_title); meta_window_set_title (window, new_title);
g_free (new_title); g_free (new_title);
@ -548,7 +548,7 @@ reload_wm_name (MetaWindow *window,
value->v.str); value->v.str);
return; return;
} }
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
set_window_title (window, value->v.str); set_window_title (window, value->v.str);
@ -796,7 +796,7 @@ reload_mwm_hints (MetaWindow *window,
meta_verbose ("Functions flag unset\n"); meta_verbose ("Functions flag unset\n");
meta_window_recalc_features (window); meta_window_recalc_features (window);
/* We do all this anyhow at the end of meta_window_x11_new() */ /* We do all this anyhow at the end of meta_window_x11_new() */
if (!window->constructing) if (!window->constructing)
{ {
@ -804,7 +804,7 @@ reload_mwm_hints (MetaWindow *window,
meta_window_ensure_frame (window); meta_window_ensure_frame (window);
else else
meta_window_destroy_frame (window); meta_window_destroy_frame (window);
meta_window_queue (window, meta_window_queue (window,
META_QUEUE_MOVE_RESIZE | META_QUEUE_MOVE_RESIZE |
/* because ensure/destroy frame may unmap: */ /* because ensure/destroy frame may unmap: */
@ -859,32 +859,32 @@ reload_net_startup_id (MetaWindow *window,
{ {
guint32 timestamp = window->net_wm_user_time; guint32 timestamp = window->net_wm_user_time;
MetaWorkspace *workspace = NULL; MetaWorkspace *workspace = NULL;
g_free (window->startup_id); g_free (window->startup_id);
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
window->startup_id = g_strdup (value->v.str); window->startup_id = g_strdup (value->v.str);
else else
window->startup_id = NULL; window->startup_id = NULL;
/* Update timestamp and workspace on a running window */ /* Update timestamp and workspace on a running window */
if (!window->constructing) if (!window->constructing)
{ {
window->initial_timestamp_set = 0; window->initial_timestamp_set = 0;
window->initial_workspace_set = 0; window->initial_workspace_set = 0;
if (meta_screen_apply_startup_properties (window->screen, window)) if (meta_screen_apply_startup_properties (window->screen, window))
{ {
if (window->initial_timestamp_set) if (window->initial_timestamp_set)
timestamp = window->initial_timestamp; timestamp = window->initial_timestamp;
if (window->initial_workspace_set) if (window->initial_workspace_set)
workspace = meta_screen_get_workspace_by_index (window->screen, window->initial_workspace); workspace = meta_screen_get_workspace_by_index (window->screen, window->initial_workspace);
meta_window_activate_with_workspace (window, timestamp, workspace); meta_window_activate_with_workspace (window, timestamp, workspace);
} }
} }
meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s\n", meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s\n",
window->startup_id ? window->startup_id : "unset", window->startup_id ? window->startup_id : "unset",
window->desc); window->desc);
@ -982,7 +982,7 @@ spew_size_hints_differences (const XSizeHints *old,
if (FLAG_CHANGED (old, new, PWinGravity)) if (FLAG_CHANGED (old, new, PWinGravity))
meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PWinGravity now %s (%d -> %d)\n", meta_topic (META_DEBUG_GEOMETRY, "XSizeHints: PWinGravity now %s (%d -> %d)\n",
FLAG_TOGGLED_ON (old, new, PWinGravity) ? "set" : "unset", FLAG_TOGGLED_ON (old, new, PWinGravity) ? "set" : "unset",
old->win_gravity, new->win_gravity); old->win_gravity, new->win_gravity);
} }
void void
@ -1335,15 +1335,15 @@ reload_normal_hints (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
XSizeHints old_hints; XSizeHints old_hints;
meta_topic (META_DEBUG_GEOMETRY, "Updating WM_NORMAL_HINTS for %s\n", window->desc); meta_topic (META_DEBUG_GEOMETRY, "Updating WM_NORMAL_HINTS for %s\n", window->desc);
old_hints = window->size_hints; old_hints = window->size_hints;
meta_set_normal_hints (window, value->v.size_hints.hints); meta_set_normal_hints (window, value->v.size_hints.hints);
spew_size_hints_differences (&old_hints, &window->size_hints); spew_size_hints_differences (&old_hints, &window->size_hints);
meta_window_recalc_features (window); meta_window_recalc_features (window);
if (!initial) if (!initial)
@ -1357,12 +1357,12 @@ reload_wm_protocols (MetaWindow *window,
gboolean initial) gboolean initial)
{ {
int i; int i;
window->take_focus = FALSE; window->take_focus = FALSE;
window->delete_window = FALSE; window->delete_window = FALSE;
window->can_ping = FALSE; window->can_ping = FALSE;
if (value->type == META_PROP_VALUE_INVALID) if (value->type == META_PROP_VALUE_INVALID)
return; return;
i = 0; i = 0;
@ -1379,7 +1379,7 @@ reload_wm_protocols (MetaWindow *window,
window->can_ping = TRUE; window->can_ping = TRUE;
++i; ++i;
} }
meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s\n", meta_verbose ("New _NET_STARTUP_ID \"%s\" for %s\n",
window->startup_id ? window->startup_id : "unset", window->startup_id ? window->startup_id : "unset",
window->desc); window->desc);
@ -1394,7 +1394,7 @@ reload_wm_hints (MetaWindow *window,
gboolean urgent; gboolean urgent;
old_group_leader = window->xgroup_leader; old_group_leader = window->xgroup_leader;
/* Fill in defaults */ /* Fill in defaults */
window->input = TRUE; window->input = TRUE;
window->initially_iconic = FALSE; window->initially_iconic = FALSE;
@ -1406,7 +1406,7 @@ reload_wm_hints (MetaWindow *window,
if (value->type != META_PROP_VALUE_INVALID) if (value->type != META_PROP_VALUE_INVALID)
{ {
const XWMHints *hints = value->v.wm_hints; const XWMHints *hints = value->v.wm_hints;
if (hints->flags & InputHint) if (hints->flags & InputHint)
window->input = hints->input; window->input = hints->input;
@ -1436,7 +1436,7 @@ reload_wm_hints (MetaWindow *window,
{ {
meta_verbose ("Window %s changed its group leader to 0x%lx\n", meta_verbose ("Window %s changed its group leader to 0x%lx\n",
window->desc, window->xgroup_leader); window->desc, window->xgroup_leader);
meta_window_group_leader_changed (window); meta_window_group_leader_changed (window);
} }
@ -1709,7 +1709,7 @@ meta_display_init_window_prop_hooks (MetaDisplay *display)
MetaWindowPropHooks *table = g_memdup (hooks, sizeof (hooks)), MetaWindowPropHooks *table = g_memdup (hooks, sizeof (hooks)),
*cursor = table; *cursor = table;
g_assert (display->prop_hooks == NULL); g_assert (display->prop_hooks == NULL);
display->prop_hooks_table = (gpointer) table; display->prop_hooks_table = (gpointer) table;

View File

@ -11,9 +11,9 @@
* round trip to the server. * round trip to the server.
*/ */
/* /*
* Copyright (C) 2001, 2002 Red Hat, Inc. * Copyright (C) 2001, 2002 Red Hat, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -23,7 +23,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */

View File

@ -2,7 +2,7 @@
/* Mutter X property convenience routines */ /* Mutter X property convenience routines */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* Copyright (C) 2002 Red Hat Inc. * Copyright (C) 2002 Red Hat Inc.
* *
@ -10,7 +10,7 @@
* Copyright 1987, 1988, 1998 The Open Group * Copyright 1987, 1988, 1998 The Open Group
* Copyright 1988 by Wyse Technology, Inc., San Jose, Ca, * Copyright 1988 by Wyse Technology, Inc., San Jose, Ca,
* Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, * Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -20,7 +20,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -31,20 +31,20 @@ Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts,
All Rights Reserved All Rights Reserved
Permission to use, copy, modify, and distribute this software and its Permission to use, copy, modify, and distribute this software and its
documentation for any purpose and without fee is hereby granted, documentation for any purpose and without fee is hereby granted,
provided that the above copyright notice appear in all copies and that provided that the above copyright notice appear in all copies and that
both that copyright notice and this permission notice appear in both that copyright notice and this permission notice appear in
supporting documentation, and that the name Digital not be supporting documentation, and that the name Digital not be
used in advertising or publicity pertaining to distribution of the used in advertising or publicity pertaining to distribution of the
software without specific, written prior permission. software without specific, written prior permission.
DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, DIGITAL AND WYSE DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR EVENT SHALL DIGITAL OR WYSE BE LIABLE FOR ANY SPECIAL, INDIRECT OR
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE. PERFORMANCE OF THIS SOFTWARE.
******************************************************************/ ******************************************************************/
@ -114,12 +114,12 @@ validate_or_free_results (GetPropertyResults *results,
const char *res_class; const char *res_class;
const char *res_name; const char *res_name;
MetaWindow *w; MetaWindow *w;
if (expected_format == results->format && if (expected_format == results->format &&
expected_type == results->type && expected_type == results->type &&
(!must_have_items || results->n_items > 0)) (!must_have_items || results->n_items > 0))
return TRUE; return TRUE;
meta_error_trap_push (results->display); meta_error_trap_push (results->display);
type_name = XGetAtomName (results->display->xdisplay, results->type); type_name = XGetAtomName (results->display->xdisplay, results->type);
expected_name = XGetAtomName (results->display->xdisplay, expected_type); expected_name = XGetAtomName (results->display->xdisplay, expected_type);
@ -140,7 +140,7 @@ validate_or_free_results (GetPropertyResults *results,
res_class = NULL; res_class = NULL;
res_name = NULL; res_name = NULL;
} }
if (title == NULL) if (title == NULL)
title = "unknown"; title = "unknown";
@ -149,7 +149,7 @@ validate_or_free_results (GetPropertyResults *results,
if (res_name == NULL) if (res_name == NULL)
res_name = "unknown"; res_name = "unknown";
meta_warning ("Window 0x%lx has property %s\nthat was expected to have type %s format %d\nand actually has type %s format %d n_items %d.\nThis is most likely an application bug, not a window manager bug.\nThe window has title=\"%s\" class=\"%s\" name=\"%s\"\n", meta_warning ("Window 0x%lx has property %s\nthat was expected to have type %s format %d\nand actually has type %s format %d n_items %d.\nThis is most likely an application bug, not a window manager bug.\nThe window has title=\"%s\" class=\"%s\" name=\"%s\"\n",
results->xwindow, results->xwindow,
prop_name ? prop_name : "(bad atom)", prop_name ? prop_name : "(bad atom)",
@ -171,7 +171,7 @@ validate_or_free_results (GetPropertyResults *results,
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
} }
return FALSE; return FALSE;
} }
@ -190,7 +190,7 @@ get_property (MetaDisplay *display,
results->type = None; results->type = None;
results->bytes_after = 0; results->bytes_after = 0;
results->format = 0; results->format = 0;
meta_error_trap_push (display); meta_error_trap_push (display);
if (XGetWindowProperty (display->xdisplay, xwindow, xatom, if (XGetWindowProperty (display->xdisplay, xwindow, xatom,
0, G_MAXLONG, 0, G_MAXLONG,
@ -222,12 +222,12 @@ atom_list_from_results (GetPropertyResults *results,
int *n_atoms_p) int *n_atoms_p)
{ {
if (!validate_or_free_results (results, 32, XA_ATOM, FALSE)) if (!validate_or_free_results (results, 32, XA_ATOM, FALSE))
return FALSE; return FALSE;
*atoms_p = (Atom*) results->prop; *atoms_p = (Atom*) results->prop;
*n_atoms_p = results->n_items; *n_atoms_p = results->n_items;
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -256,12 +256,12 @@ cardinal_list_from_results (GetPropertyResults *results,
int *n_cardinals_p) int *n_cardinals_p)
{ {
if (!validate_or_free_results (results, 32, XA_CARDINAL, FALSE)) if (!validate_or_free_results (results, 32, XA_CARDINAL, FALSE))
return FALSE; return FALSE;
*cardinals_p = (gulong*) results->prop; *cardinals_p = (gulong*) results->prop;
*n_cardinals_p = results->n_items; *n_cardinals_p = results->n_items;
results->prop = NULL; results->prop = NULL;
#if GLIB_SIZEOF_LONG == 8 #if GLIB_SIZEOF_LONG == 8
/* Xlib sign-extends format=32 items, but we want them unsigned */ /* Xlib sign-extends format=32 items, but we want them unsigned */
{ {
@ -300,8 +300,8 @@ motif_hints_from_results (GetPropertyResults *results,
{ {
int real_size, max_size; int real_size, max_size;
#define MAX_ITEMS sizeof (MotifWmHints)/sizeof (gulong) #define MAX_ITEMS sizeof (MotifWmHints)/sizeof (gulong)
*hints_p = NULL; *hints_p = NULL;
if (results->type == None || results->n_items <= 0) if (results->type == None || results->n_items <= 0)
{ {
@ -337,7 +337,7 @@ motif_hints_from_results (GetPropertyResults *results,
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
} }
return TRUE; return TRUE;
} }
@ -348,7 +348,7 @@ meta_prop_get_motif_hints (MetaDisplay *display,
MotifWmHints **hints_p) MotifWmHints **hints_p)
{ {
GetPropertyResults results; GetPropertyResults results;
*hints_p = NULL; *hints_p = NULL;
if (!get_property (display, xwindow, xatom, AnyPropertyType, if (!get_property (display, xwindow, xatom, AnyPropertyType,
@ -363,13 +363,13 @@ latin1_string_from_results (GetPropertyResults *results,
char **str_p) char **str_p)
{ {
*str_p = NULL; *str_p = NULL;
if (!validate_or_free_results (results, 8, XA_STRING, FALSE)) if (!validate_or_free_results (results, 8, XA_STRING, FALSE))
return FALSE; return FALSE;
*str_p = (char*) results->prop; *str_p = (char*) results->prop;
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -386,7 +386,7 @@ meta_prop_get_latin1_string (MetaDisplay *display,
if (!get_property (display, xwindow, xatom, XA_STRING, if (!get_property (display, xwindow, xatom, XA_STRING,
&results)) &results))
return FALSE; return FALSE;
return latin1_string_from_results (&results, str_p); return latin1_string_from_results (&results, str_p);
} }
@ -395,7 +395,7 @@ utf8_string_from_results (GetPropertyResults *results,
char **str_p) char **str_p)
{ {
*str_p = NULL; *str_p = NULL;
if (!validate_or_free_results (results, 8, if (!validate_or_free_results (results, 8,
results->display->atom_UTF8_STRING, FALSE)) results->display->atom_UTF8_STRING, FALSE))
return FALSE; return FALSE;
@ -411,13 +411,13 @@ utf8_string_from_results (GetPropertyResults *results,
meta_XFree (name); meta_XFree (name);
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
return FALSE; return FALSE;
} }
*str_p = (char*) results->prop; *str_p = (char*) results->prop;
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -449,14 +449,14 @@ utf8_list_from_results (GetPropertyResults *results,
int n_strings; int n_strings;
char **retval; char **retval;
const char *p; const char *p;
*str_p = NULL; *str_p = NULL;
*n_str_p = 0; *n_str_p = 0;
if (!validate_or_free_results (results, 8, if (!validate_or_free_results (results, 8,
results->display->atom_UTF8_STRING, FALSE)) results->display->atom_UTF8_STRING, FALSE))
return FALSE; return FALSE;
/* I'm not sure this is right, but I'm guessing the /* I'm not sure this is right, but I'm guessing the
* property is nul-separated * property is nul-separated
*/ */
@ -471,11 +471,11 @@ utf8_list_from_results (GetPropertyResults *results,
if (results->prop[results->n_items - 1] != '\0') if (results->prop[results->n_items - 1] != '\0')
++n_strings; ++n_strings;
/* we're guaranteed that results->prop has a nul on the end /* we're guaranteed that results->prop has a nul on the end
* by XGetWindowProperty * by XGetWindowProperty
*/ */
retval = g_new0 (char*, n_strings + 1); retval = g_new0 (char*, n_strings + 1);
p = (char *)results->prop; p = (char *)results->prop;
@ -494,17 +494,17 @@ utf8_list_from_results (GetPropertyResults *results,
meta_XFree (name); meta_XFree (name);
meta_XFree (results->prop); meta_XFree (results->prop);
results->prop = NULL; results->prop = NULL;
g_strfreev (retval); g_strfreev (retval);
return FALSE; return FALSE;
} }
retval[i] = g_strdup (p); retval[i] = g_strdup (p);
p = p + strlen (p) + 1; p = p + strlen (p) + 1;
++i; ++i;
} }
*str_p = retval; *str_p = retval;
*n_str_p = i; *n_str_p = i;
@ -544,13 +544,13 @@ latin1_list_from_results (GetPropertyResults *results,
int n_strings; int n_strings;
char **retval; char **retval;
const char *p; const char *p;
*str_p = NULL; *str_p = NULL;
*n_str_p = 0; *n_str_p = 0;
if (!validate_or_free_results (results, 8, XA_STRING, FALSE)) if (!validate_or_free_results (results, 8, XA_STRING, FALSE))
return FALSE; return FALSE;
/* I'm not sure this is right, but I'm guessing the /* I'm not sure this is right, but I'm guessing the
* property is nul-separated * property is nul-separated
*/ */
@ -565,11 +565,11 @@ latin1_list_from_results (GetPropertyResults *results,
if (results->prop[results->n_items - 1] != '\0') if (results->prop[results->n_items - 1] != '\0')
++n_strings; ++n_strings;
/* we're guaranteed that results->prop has a nul on the end /* we're guaranteed that results->prop has a nul on the end
* by XGetWindowProperty * by XGetWindowProperty
*/ */
retval = g_new0 (char*, n_strings + 1); retval = g_new0 (char*, n_strings + 1);
p = (char *)results->prop; p = (char *)results->prop;
@ -577,11 +577,11 @@ latin1_list_from_results (GetPropertyResults *results,
while (i < n_strings) while (i < n_strings)
{ {
retval[i] = g_strdup (p); retval[i] = g_strdup (p);
p = p + strlen (p) + 1; p = p + strlen (p) + 1;
++i; ++i;
} }
*str_p = retval; *str_p = retval;
*n_str_p = i; *n_str_p = i;
@ -616,9 +616,9 @@ meta_prop_set_utf8_string_hint (MetaDisplay *display,
const char *val) const char *val)
{ {
meta_error_trap_push (display); meta_error_trap_push (display);
XChangeProperty (display->xdisplay, XChangeProperty (display->xdisplay,
xwindow, atom, xwindow, atom,
display->atom_UTF8_STRING, display->atom_UTF8_STRING,
8, PropModeReplace, (guchar*) val, strlen (val)); 8, PropModeReplace, (guchar*) val, strlen (val));
meta_error_trap_pop (display); meta_error_trap_pop (display);
} }
@ -628,12 +628,12 @@ window_from_results (GetPropertyResults *results,
Window *window_p) Window *window_p)
{ {
if (!validate_or_free_results (results, 32, XA_WINDOW, TRUE)) if (!validate_or_free_results (results, 32, XA_WINDOW, TRUE))
return FALSE; return FALSE;
*window_p = *(Window*) results->prop; *window_p = *(Window*) results->prop;
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -644,12 +644,12 @@ counter_from_results (GetPropertyResults *results,
if (!validate_or_free_results (results, 32, if (!validate_or_free_results (results, 32,
XA_CARDINAL, XA_CARDINAL,
TRUE)) TRUE))
return FALSE; return FALSE;
*counter_p = *(XSyncCounter*) results->prop; *counter_p = *(XSyncCounter*) results->prop;
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -679,7 +679,7 @@ meta_prop_get_window (MetaDisplay *display,
GetPropertyResults results; GetPropertyResults results;
*window_p = None; *window_p = None;
if (!get_property (display, xwindow, xatom, XA_WINDOW, if (!get_property (display, xwindow, xatom, XA_WINDOW,
&results)) &results))
return FALSE; return FALSE;
@ -703,7 +703,7 @@ cardinal_with_atom_type_from_results (GetPropertyResults *results,
gulong *cardinal_p) gulong *cardinal_p)
{ {
if (!validate_or_free_results (results, 32, prop_type, TRUE)) if (!validate_or_free_results (results, 32, prop_type, TRUE))
return FALSE; return FALSE;
*cardinal_p = *(gulong*) results->prop; *cardinal_p = *(gulong*) results->prop;
#if GLIB_SIZEOF_LONG == 8 #if GLIB_SIZEOF_LONG == 8
@ -711,8 +711,8 @@ cardinal_with_atom_type_from_results (GetPropertyResults *results,
*cardinal_p &= 0xffffffff; *cardinal_p &= 0xffffffff;
#endif #endif
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -769,13 +769,13 @@ text_property_from_results (GetPropertyResults *results,
results->prop = NULL; results->prop = NULL;
tp.encoding = results->type; tp.encoding = results->type;
tp.format = results->format; tp.format = results->format;
tp.nitems = results->n_items; tp.nitems = results->n_items;
*utf8_str_p = text_property_to_utf8 (results->display->xdisplay, &tp); *utf8_str_p = text_property_to_utf8 (results->display->xdisplay, &tp);
if (tp.value != NULL) if (tp.value != NULL)
XFree (tp.value); XFree (tp.value);
return *utf8_str_p != NULL; return *utf8_str_p != NULL;
} }
@ -786,7 +786,7 @@ meta_prop_get_text_property (MetaDisplay *display,
char **utf8_str_p) char **utf8_str_p)
{ {
GetPropertyResults results; GetPropertyResults results;
if (!get_property (display, xwindow, xatom, AnyPropertyType, if (!get_property (display, xwindow, xatom, AnyPropertyType,
&results)) &results))
return FALSE; return FALSE;
@ -825,13 +825,13 @@ wm_hints_from_results (GetPropertyResults *results,
{ {
XWMHints *hints; XWMHints *hints;
xPropWMHints *raw; xPropWMHints *raw;
*hints_p = NULL;
if (!validate_or_free_results (results, 32, XA_WM_HINTS, TRUE))
return FALSE;
/* pre-R3 bogusly truncated window_group, don't fail on them */ *hints_p = NULL;
if (!validate_or_free_results (results, 32, XA_WM_HINTS, TRUE))
return FALSE;
/* pre-R3 bogusly truncated window_group, don't fail on them */
if (results->n_items < (NumPropWMHintsElements - 1)) if (results->n_items < (NumPropWMHintsElements - 1))
{ {
meta_verbose ("WM_HINTS property too short: %d should be %d\n", meta_verbose ("WM_HINTS property too short: %d should be %d\n",
@ -843,11 +843,11 @@ wm_hints_from_results (GetPropertyResults *results,
} }
return FALSE; return FALSE;
} }
hints = ag_Xmalloc0 (sizeof (XWMHints)); hints = ag_Xmalloc0 (sizeof (XWMHints));
raw = (xPropWMHints*) results->prop; raw = (xPropWMHints*) results->prop;
hints->flags = raw->flags; hints->flags = raw->flags;
hints->input = (raw->input ? True : False); hints->input = (raw->input ? True : False);
hints->initial_state = cvtINT32toInt (raw->initialState); hints->initial_state = cvtINT32toInt (raw->initialState);
@ -881,7 +881,7 @@ meta_prop_get_wm_hints (MetaDisplay *display,
GetPropertyResults results; GetPropertyResults results;
*hints_p = NULL; *hints_p = NULL;
if (!get_property (display, xwindow, xatom, XA_WM_HINTS, if (!get_property (display, xwindow, xatom, XA_WM_HINTS,
&results)) &results))
return FALSE; return FALSE;
@ -894,13 +894,13 @@ class_hint_from_results (GetPropertyResults *results,
XClassHint *class_hint) XClassHint *class_hint)
{ {
int len_name, len_class; int len_name, len_class;
class_hint->res_class = NULL; class_hint->res_class = NULL;
class_hint->res_name = NULL; class_hint->res_name = NULL;
if (!validate_or_free_results (results, 8, XA_STRING, FALSE)) if (!validate_or_free_results (results, 8, XA_STRING, FALSE))
return FALSE; return FALSE;
len_name = strlen ((char *) results->prop); len_name = strlen ((char *) results->prop);
if (! (class_hint->res_name = ag_Xmalloc (len_name+1))) if (! (class_hint->res_name = ag_Xmalloc (len_name+1)))
{ {
@ -908,14 +908,14 @@ class_hint_from_results (GetPropertyResults *results,
results->prop = NULL; results->prop = NULL;
return FALSE; return FALSE;
} }
strcpy (class_hint->res_name, (char *)results->prop); strcpy (class_hint->res_name, (char *)results->prop);
if (len_name == (int) results->n_items) if (len_name == (int) results->n_items)
len_name--; len_name--;
len_class = strlen ((char *)results->prop + len_name + 1); len_class = strlen ((char *)results->prop + len_name + 1);
if (! (class_hint->res_class = ag_Xmalloc(len_class+1))) if (! (class_hint->res_class = ag_Xmalloc(len_class+1)))
{ {
XFree(class_hint->res_name); XFree(class_hint->res_name);
@ -924,12 +924,12 @@ class_hint_from_results (GetPropertyResults *results,
results->prop = NULL; results->prop = NULL;
return FALSE; return FALSE;
} }
strcpy (class_hint->res_class, (char *)results->prop + len_name + 1); strcpy (class_hint->res_class, (char *)results->prop + len_name + 1);
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
return TRUE; return TRUE;
} }
@ -940,10 +940,10 @@ meta_prop_get_class_hint (MetaDisplay *display,
XClassHint *class_hint) XClassHint *class_hint)
{ {
GetPropertyResults results; GetPropertyResults results;
class_hint->res_class = NULL; class_hint->res_class = NULL;
class_hint->res_name = NULL; class_hint->res_name = NULL;
if (!get_property (display, xwindow, xatom, XA_STRING, if (!get_property (display, xwindow, xatom, XA_STRING,
&results)) &results))
return FALSE; return FALSE;
@ -958,10 +958,10 @@ size_hints_from_results (GetPropertyResults *results,
{ {
xPropSizeHints *raw; xPropSizeHints *raw;
XSizeHints *hints; XSizeHints *hints;
*hints_p = NULL; *hints_p = NULL;
*flags_p = 0; *flags_p = 0;
if (!validate_or_free_results (results, 32, XA_WM_SIZE_HINTS, FALSE)) if (!validate_or_free_results (results, 32, XA_WM_SIZE_HINTS, FALSE))
return FALSE; return FALSE;
@ -971,7 +971,7 @@ size_hints_from_results (GetPropertyResults *results,
raw = (xPropSizeHints*) results->prop; raw = (xPropSizeHints*) results->prop;
hints = ag_Xmalloc (sizeof (XSizeHints)); hints = ag_Xmalloc (sizeof (XSizeHints));
/* XSizeHints misdeclares these as int instead of long */ /* XSizeHints misdeclares these as int instead of long */
hints->flags = raw->flags; hints->flags = raw->flags;
hints->x = cvtINT32toInt (raw->x); hints->x = cvtINT32toInt (raw->x);
@ -999,12 +999,12 @@ size_hints_from_results (GetPropertyResults *results,
} }
hints->flags &= (*flags_p); /* get rid of unwanted bits */ hints->flags &= (*flags_p); /* get rid of unwanted bits */
XFree (results->prop); XFree (results->prop);
results->prop = NULL; results->prop = NULL;
*hints_p = hints; *hints_p = hints;
return TRUE; return TRUE;
} }
@ -1019,7 +1019,7 @@ meta_prop_get_size_hints (MetaDisplay *display,
*hints_p = NULL; *hints_p = NULL;
*flags_p = 0; *flags_p = 0;
if (!get_property (display, xwindow, xatom, XA_WM_SIZE_HINTS, if (!get_property (display, xwindow, xatom, XA_WM_SIZE_HINTS,
&results)) &results))
return FALSE; return FALSE;
@ -1044,7 +1044,7 @@ latin1_to_utf8 (const char *text)
{ {
GString *str; GString *str;
const char *p; const char *p;
str = g_string_new (""); str = g_string_new ("");
p = text; p = text;
@ -1068,10 +1068,10 @@ meta_prop_get_values (MetaDisplay *display,
meta_verbose ("Requesting %d properties of 0x%lx at once\n", meta_verbose ("Requesting %d properties of 0x%lx at once\n",
n_values, xwindow); n_values, xwindow);
if (n_values == 0) if (n_values == 0)
return; return;
tasks = g_new0 (AgGetPropertyTask*, n_values); tasks = g_new0 (AgGetPropertyTask*, n_values);
/* Start up tasks. The "values" array can have values /* Start up tasks. The "values" array can have values
@ -1134,22 +1134,22 @@ meta_prop_get_values (MetaDisplay *display,
if (values[i].atom != None) if (values[i].atom != None)
tasks[i] = get_task (display, xwindow, tasks[i] = get_task (display, xwindow,
values[i].atom, values[i].required_type); values[i].atom, values[i].required_type);
++i; ++i;
} }
/* Get replies for all our tasks */ /* Get replies for all our tasks */
meta_topic (META_DEBUG_SYNC, "Syncing to get %d GetProperty replies in %s\n", meta_topic (META_DEBUG_SYNC, "Syncing to get %d GetProperty replies in %s\n",
n_values, G_STRFUNC); n_values, G_STRFUNC);
XSync (display->xdisplay, False); XSync (display->xdisplay, False);
/* Collect results, should arrive in order requested */ /* Collect results, should arrive in order requested */
i = 0; i = 0;
while (i < n_values) while (i < n_values)
{ {
AgGetPropertyTask *task; AgGetPropertyTask *task;
GetPropertyResults results; GetPropertyResults results;
if (tasks[i] == NULL) if (tasks[i] == NULL)
{ {
/* Probably values[i].type was None, or ag_task_create() /* Probably values[i].type was None, or ag_task_create()
@ -1158,7 +1158,7 @@ meta_prop_get_values (MetaDisplay *display,
values[i].type = META_PROP_VALUE_INVALID; values[i].type = META_PROP_VALUE_INVALID;
goto next; goto next;
} }
task = ag_get_next_completed_task (display->xdisplay); task = ag_get_next_completed_task (display->xdisplay);
g_assert (task != NULL); g_assert (task != NULL);
g_assert (ag_task_have_reply (task)); g_assert (ag_task_have_reply (task));
@ -1171,7 +1171,7 @@ meta_prop_get_values (MetaDisplay *display,
results.type = None; results.type = None;
results.bytes_after = 0; results.bytes_after = 0;
results.format = 0; results.format = 0;
if (ag_task_get_reply_and_free (task, if (ag_task_get_reply_and_free (task,
&results.type, &results.format, &results.type, &results.format,
&results.n_items, &results.n_items,
@ -1301,7 +1301,7 @@ free_value (MetaPropValue *value)
{ {
switch (value->type) switch (value->type)
{ {
case META_PROP_VALUE_INVALID: case META_PROP_VALUE_INVALID:
break; break;
case META_PROP_VALUE_UTF8: case META_PROP_VALUE_UTF8:
case META_PROP_VALUE_STRING: case META_PROP_VALUE_STRING:
@ -1310,10 +1310,10 @@ free_value (MetaPropValue *value)
break; break;
case META_PROP_VALUE_MOTIF_HINTS: case META_PROP_VALUE_MOTIF_HINTS:
meta_XFree (value->v.motif_hints); meta_XFree (value->v.motif_hints);
break; break;
case META_PROP_VALUE_CARDINAL: case META_PROP_VALUE_CARDINAL:
break; break;
case META_PROP_VALUE_WINDOW: case META_PROP_VALUE_WINDOW:
break; break;
case META_PROP_VALUE_ATOM_LIST: case META_PROP_VALUE_ATOM_LIST:
meta_XFree (value->v.atom_list.atoms); meta_XFree (value->v.atom_list.atoms);

View File

@ -2,9 +2,9 @@
/* Mutter X property convenience routines */ /* Mutter X property convenience routines */
/* /*
* Copyright (C) 2001 Havoc Pennington * Copyright (C) 2001 Havoc Pennington
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as * modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the * published by the Free Software Foundation; either version 2 of the
@ -14,7 +14,7 @@
* WITHOUT ANY WARRANTY; without even the implied warranty of * WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details. * General Public License for more details.
* *
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with this program; if not, see <http://www.gnu.org/licenses/>. * along with this program; if not, see <http://www.gnu.org/licenses/>.
*/ */
@ -168,7 +168,7 @@ typedef struct
MetaPropValueType type; MetaPropValueType type;
Atom atom; Atom atom;
Atom required_type; /* autofilled if None */ Atom required_type; /* autofilled if None */
union union
{ {
char *str; char *str;
@ -183,13 +183,13 @@ typedef struct
gulong *counters; gulong *counters;
int n_counters; int n_counters;
} xcounter_list; } xcounter_list;
struct struct
{ {
XSizeHints *hints; XSizeHints *hints;
unsigned long flags; unsigned long flags;
} size_hints; } size_hints;
struct struct
{ {
gulong *cardinals; gulong *cardinals;
@ -207,7 +207,7 @@ typedef struct
Atom *atoms; Atom *atoms;
int n_atoms; int n_atoms;
} atom_list; } atom_list;
} v; } v;
} MetaPropValue; } MetaPropValue;