mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
update to upstream 2.25.1
Merge commit '49cc773eb4801fb0ee3cddeeb1d27042f4a46e2e' into clutter
This commit is contained in:
commit
438ac55cb1
108
ChangeLog
108
ChangeLog
@ -1,3 +1,111 @@
|
||||
2008-09-01 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* NEWS: 2.25.1 release.
|
||||
|
||||
2008-09-01 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* src/core/workspace.c: When a workspace's list of struts
|
||||
is freed, free the struts too. Closes #549952, and #468075.
|
||||
|
||||
2008-09-01 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
Add new move_to_center keybinding, requested by Khanh-Dang Nguyen
|
||||
Thu Lam; closes #549979.
|
||||
|
||||
* src/include/prefs.h (void): add name of new binding
|
||||
* src/core/prefs.c: added pref for it
|
||||
* src/core/keybindings.c (handle_move_to_center): new function
|
||||
* src/metacity.schemas.in: included new binding
|
||||
|
||||
2008-08-31 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* src/core/prefs.[ch] (meta_prefs_set_compositing_manager): new
|
||||
function.
|
||||
* src/core/main.c (meta_parse_options): turn the compositing
|
||||
manager on or off as necessary.
|
||||
|
||||
2008-08-30 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* src/core/window.c (process_property_notify): moving all
|
||||
messages about properties to the top, as a start at #549886
|
||||
|
||||
2008-08-18 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* NEWS: fix version number which broke
|
||||
|
||||
2008-08-18 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* configure.in: Post-release version bump to 2.25.1.
|
||||
|
||||
2008-08-18 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* configure.in: correct incorrect version number
|
||||
|
||||
2008-08-18 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* NEWS: 2.25.1 release.
|
||||
|
||||
2008-08-18 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
Adding doxygen headers to some files.
|
||||
|
||||
* src/core/metacity-Xatomtype.h
|
||||
* src/core/main.c
|
||||
* src/core/screen-private.h
|
||||
* src/core/window-private.h
|
||||
* src/core/keybindings.h
|
||||
* src/core/session.h
|
||||
* src/core/workspace.h
|
||||
* src/core/window-props.h ()
|
||||
|
||||
2008-08-18 Eric Piel <e.a.b.piel@tudelft.nl>
|
||||
|
||||
* src/core/workspace.c (ensure_work_areas_validated): add a copy of
|
||||
each strut in a window to the workspace's strut list, instead of
|
||||
using the copy in the list (which would mean it was double-freed).
|
||||
Believed to fix #468075.
|
||||
|
||||
2008-08-16 Ted Percival <ted@midg3t.net>
|
||||
|
||||
Ensure the user_rect is set sanely for windows that start maximized.
|
||||
Prevents maximized windows from warping across the screen.
|
||||
Fixes bug #504692.
|
||||
|
||||
* src/core/window.c (save_user_placement): renamed version of
|
||||
meta_window_save_user_rect().
|
||||
* src/core/window.c (force_save_user_placement): similar, but will
|
||||
always save user_rect even if the window is maximised or fullscreen.
|
||||
* src/core/window.c (meta_window_move_resize_internal): unplaced
|
||||
windows have force_save_user_placement() called instead of
|
||||
save_user_placement().
|
||||
|
||||
2008-08-14 Patrick Niklaus <marex@compiz-fusion.org>
|
||||
|
||||
Icons for windows are taken from the desktop theme, not from
|
||||
the Metacity theme or from the fallback icon that Metacity
|
||||
provided. Closes #524343.
|
||||
|
||||
* src/ui/ui.c: Use GtkIconTheme to load the default window icon.
|
||||
Assumes the existence of an icon called "window", otherwise
|
||||
falls back to "gtk-missing-image". Fixes #524343.
|
||||
* src/ui/preview-widget: See above.
|
||||
* src/include/common.h: Add META_DEFAULT_ICON_NAME.
|
||||
* src/Makefile.am: Remove default_icon.png from inlinepixbufs.h.
|
||||
* src/default_icon.png: Removed.
|
||||
|
||||
2008-08-14 Akira TAGOH <akira@tagoh.org>
|
||||
|
||||
* doc/man/metacity-message.1: new manual page.
|
||||
* doc/man/Makefile.am: added new reference.
|
||||
|
||||
2008-08-13 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* configure.in: Post-branch bump to 2.25.0.
|
||||
|
||||
2008-08-04 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* configure.in: Post-release bump to 2.23.144.
|
||||
|
||||
2008-08-04 Thomas Thurman <tthurman@gnome.org>
|
||||
|
||||
* NEWS: 2.23.89 release.
|
||||
|
34
NEWS
34
NEWS
@ -1,3 +1,37 @@
|
||||
2.25.1
|
||||
======
|
||||
|
||||
Thanks to Thomas Thurman for improvements in this version.
|
||||
|
||||
- Fix small memory leak, found by Matthias Clasen (Thomas) (#549952)
|
||||
- Added move_to_center keybinding suggested by
|
||||
Khanh-Dang Nguyen Thu Lam (Thomas) (#549979)
|
||||
- Compositor can be turned on and off from the command line
|
||||
(#545323) (Thomas)
|
||||
|
||||
Translations
|
||||
Khaled Hosny (ar), Petr Kovar (cs), Iñaki Larrañaga Murgoitio (eu), Ilkka
|
||||
Tuohela (fi), Žygimantas Beručka (lt), Duarte Loreto (pt), Djavan
|
||||
Fagundes (pt_BR), Laurent Dhima (sq)
|
||||
|
||||
2.25.0
|
||||
======
|
||||
|
||||
Thanks to Patrick Niklaus, Ted Percival, Eric Piel, Akira TAGOH, and Thomas
|
||||
Thurman for improvements in this version.
|
||||
|
||||
- Fix memory allocation problem in struts (Eric) (probably #468075)
|
||||
- Ensure windows which start maximised know where to jump back
|
||||
to, so they don't warp to other screens (Ted) (#504692)
|
||||
- Added header comments to some files (Thomas)
|
||||
- Icons for windows which are uncooperative enough not to provide
|
||||
an icon are taken from the theme, not built in (Patrick) (#524343)
|
||||
- Added manual page for metacity-message (Akira, from Debian downstream)
|
||||
|
||||
Translations
|
||||
Khaled Hosny (ar), Petr Kovar (cs), Ilkka Tuohela (fi), Duarte Loreto (pt), Djavan
|
||||
Fagundes (pt_BR)
|
||||
|
||||
2.23.89
|
||||
=======
|
||||
|
||||
|
@ -1,10 +1,10 @@
|
||||
AC_PREREQ(2.50)
|
||||
|
||||
m4_define([metacity_major_version], [2])
|
||||
m4_define([metacity_minor_version], [23])
|
||||
m4_define([metacity_minor_version], [25])
|
||||
# Fibonacci sequence for micro version numbering:
|
||||
# 0, 1, 1, 2, 3, 5, 8, 13, 21, 34, 55, 89, 144, 233, 377, 610, 987
|
||||
m4_define([metacity_micro_version], [89])
|
||||
m4_define([metacity_micro_version], [1])
|
||||
|
||||
m4_define([metacity_version],
|
||||
[metacity_major_version.metacity_minor_version.metacity_micro_version])
|
||||
|
@ -1,3 +1,4 @@
|
||||
man_MANS = metacity.1 metacity-theme-viewer.1 metacity-window-demo.1
|
||||
man_MANS = metacity.1 metacity-theme-viewer.1 \
|
||||
metacity-window-demo.1 metacity-message.1
|
||||
|
||||
EXTRA_DIST = $(man_MANS)
|
||||
|
60
doc/man/metacity-message.1
Normal file
60
doc/man/metacity-message.1
Normal file
@ -0,0 +1,60 @@
|
||||
.\" Hey, EMACS: -*- nroff -*-
|
||||
.\" First parameter, NAME, should be all caps
|
||||
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
|
||||
.\" other parameters are allowed: see man(7), man(1)
|
||||
.\" -----
|
||||
.\" This file was confirmed to be licenced under the GPL
|
||||
.\" by its author and copyright holder, Akira TAGOH, on June 1st 2008:
|
||||
.\"
|
||||
.\" > I'm comfortable with DFSG-free. that sounds great if you think it's
|
||||
.\" > useful and worth containing it in upstream.
|
||||
.\" ...
|
||||
.\" > Right I know. any licenses that is DFSG-free, I'm ok with whatever,
|
||||
.\" > since I have contributed that for Debian. so GPL is no problem for me.
|
||||
.\" -----
|
||||
.TH METACITY\-MESSAGE 1 "28 August 2002"
|
||||
.\" Please adjust this date whenever revising the manpage.
|
||||
.\"
|
||||
.\" Some roff macros, for reference:
|
||||
.\" .nh disable hyphenation
|
||||
.\" .hy enable hyphenation
|
||||
.\" .ad l left justify
|
||||
.\" .ad b justify to both left and right margins
|
||||
.\" .nf disable filling
|
||||
.\" .fi enable filling
|
||||
.\" .br insert line break
|
||||
.\" .sp <n> insert n+1 empty lines
|
||||
.\" for manpage-specific macros, see man(7)
|
||||
.SH NAME
|
||||
METACITY\-MESSAGE \- a command to send a message to Metacity
|
||||
.SH SYNOPSIS
|
||||
.B METACITY\-MESSAGE
|
||||
[restart|reload\-theme|enable\-keybindings|disable\-keybindings]
|
||||
.SH DESCRIPTION
|
||||
This manual page documents briefly the
|
||||
.B metacity\-message\fP.
|
||||
This manual page was written for the Debian distribution
|
||||
because the original program does not have a manual page.
|
||||
.PP
|
||||
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
|
||||
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
|
||||
.\" respectively.
|
||||
\fBmetacity\-message\fP send a specified message to \fBmetacity\fP(1).
|
||||
.SH OPTIONS
|
||||
.TP
|
||||
.B restart
|
||||
Restart \fBmetacity\fP(1) which is running.
|
||||
.TP
|
||||
.B reload-theme
|
||||
Reload a theme which is specified on gconf database.
|
||||
.TP
|
||||
.B enable-keybindings
|
||||
Enable all of keybindings which is specified on gconf database.
|
||||
.TP
|
||||
.B disable-keybindings
|
||||
Disable all of keybindings which is specified on gconf database.
|
||||
.SH SEE ALSO
|
||||
.BR metacity (1)
|
||||
.SH AUTHOR
|
||||
This manual page was written by Akira TAGOH <tagoh@debian.org>,
|
||||
for the Debian GNU/Linux system (but may be used by others).
|
37
po/ChangeLog
37
po/ChangeLog
@ -1,3 +1,40 @@
|
||||
2008-08-24 Gintautas Miliauskas <gintas@akl.lt>
|
||||
|
||||
* lt.po: Updated Lithuanian translation.
|
||||
|
||||
2008-08-23 Inaki Larranaga Murgoitio <dooteo@euskalgnu.org>
|
||||
|
||||
* eu.po: Updated Basque translation.
|
||||
|
||||
2008-08-21 Laurent Dhima <laurenti@alblinux.net>
|
||||
|
||||
* sq.po: Updated Albanian Translation.
|
||||
|
||||
2008-08-14 Duarte Loreto <happyguy_pt@hotmail.com>
|
||||
|
||||
* pt.po: Updated Portuguese translation.
|
||||
|
||||
2008-08-13 Leonardo Ferreira Fontenelle <leonardof@gnome.org>
|
||||
|
||||
* pt_BR.po: Brazilian Portuguese translation updated by Djavan
|
||||
Fagundes.
|
||||
|
||||
2008-08-13 Ilkka Tuohela <hile@iki.fi>
|
||||
|
||||
* fi.po: Updated Finnish translation.
|
||||
|
||||
2008-08-09 Petr Kovar <pknbe@volny.cz>
|
||||
|
||||
* cs.po: Updated Czech translation.
|
||||
|
||||
2008-08-07 Ignacio Casal Quinteiro <nacho.resa@gmail.com>
|
||||
|
||||
gl.po: Updated Galician translation
|
||||
|
||||
2008-08-6 Djihed Afifi <djihed@gmail.com>
|
||||
|
||||
* ar.po: Updated Arabic Translation by Khaled Hosny.
|
||||
|
||||
2008-08-02 Takeshi AIHANA <takeshi.aihana@gmail.com>
|
||||
|
||||
* ja.po: Updated Japanese translation.
|
||||
|
28
po/ar.po
28
po/ar.po
@ -11,7 +11,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: metacity.HEAD.ar\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2008-07-29 02:20+0100\n"
|
||||
"POT-Creation-Date: 2008-08-18 15:06+0100\n"
|
||||
"PO-Revision-Date: 2008-01-13 01:49+0200\n"
|
||||
"Last-Translator: Khaled Hosny <khaledhosny@eglug.org>\n"
|
||||
"Language-Team: Arabic <doc@arabeyes.org>\n"
|
||||
@ -117,7 +117,7 @@ msgstr "لم يُعرّف أمر %d.\n"
|
||||
msgid "No terminal command has been defined.\n"
|
||||
msgstr "لم يُعرّف أمر طرفيّة.\n"
|
||||
|
||||
#: ../src/core/main.c:115
|
||||
#: ../src/core/main.c:116
|
||||
#, fuzzy, c-format
|
||||
msgid ""
|
||||
"metacity %s\n"
|
||||
@ -131,46 +131,46 @@ msgstr ""
|
||||
"هذا برنامج حر، راجع المصدر لشروط النسخ. لا يوجد أي ضمان، و لا ضمان بيع و لا "
|
||||
"مناسبة لأي هدف.\n"
|
||||
|
||||
#: ../src/core/main.c:242
|
||||
#: ../src/core/main.c:243
|
||||
msgid "Disable connection to session manager"
|
||||
msgstr "عطّل الاتصال بمدير الجلسة"
|
||||
|
||||
#: ../src/core/main.c:248
|
||||
#: ../src/core/main.c:249
|
||||
msgid "Replace the running window manager with Metacity"
|
||||
msgstr "استبدل مدير النوافذ الذي يعمل بمِتسِتي"
|
||||
|
||||
#: ../src/core/main.c:254
|
||||
#: ../src/core/main.c:255
|
||||
msgid "Specify session management ID"
|
||||
msgstr "حدّد رقم هويّة إدارة الجلسة"
|
||||
|
||||
#: ../src/core/main.c:259
|
||||
#: ../src/core/main.c:260
|
||||
msgid "X Display to use"
|
||||
msgstr "معراض س الذي سيستعمل"
|
||||
|
||||
#: ../src/core/main.c:265
|
||||
#: ../src/core/main.c:266
|
||||
msgid "Initialize session from savefile"
|
||||
msgstr "ابدأ الجلسة من ملف محفوظ"
|
||||
|
||||
#: ../src/core/main.c:271
|
||||
#: ../src/core/main.c:272
|
||||
msgid "Print version"
|
||||
msgstr "اطبع الإصدارة"
|
||||
|
||||
#: ../src/core/main.c:277
|
||||
#: ../src/core/main.c:278
|
||||
msgid "Make X calls synchronous"
|
||||
msgstr "اجعل نداءات س متزامنة"
|
||||
|
||||
#: ../src/core/main.c:428
|
||||
#: ../src/core/main.c:429
|
||||
#, c-format
|
||||
msgid "Failed to scan themes directory: %s\n"
|
||||
msgstr "فشلت قراءة دليل السِمات : %s\n"
|
||||
|
||||
#: ../src/core/main.c:444
|
||||
#: ../src/core/main.c:445
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Could not find a theme! Be sure %s exists and contains the usual themes.\n"
|
||||
msgstr "تعذّر ايجاد سِمة! تأكد من وجود %s و احتواءه على السِمات معتادة.\n"
|
||||
|
||||
#: ../src/core/main.c:500
|
||||
#: ../src/core/main.c:501
|
||||
#, c-format
|
||||
msgid "Failed to restart: %s\n"
|
||||
msgstr "فشلت اعادة التشغيل: %s\n"
|
||||
@ -402,7 +402,7 @@ msgid "Invalid WM_TRANSIENT_FOR window 0x%lx specified for %s.\n"
|
||||
msgstr "نافذة WM_TRANSIENT_FOR 0x%lx غير صحيحة ل %s.\n"
|
||||
|
||||
#. first time through
|
||||
#: ../src/core/window.c:5648
|
||||
#: ../src/core/window.c:5664
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Window %s sets SM_CLIENT_ID on itself, instead of on the WM_CLIENT_LEADER "
|
||||
@ -418,7 +418,7 @@ msgstr ""
|
||||
#. * MWM but not WM_NORMAL_HINTS are basically broken. We complain
|
||||
#. * about these apps but make them work.
|
||||
#.
|
||||
#: ../src/core/window.c:6213
|
||||
#: ../src/core/window.c:6229
|
||||
#, c-format
|
||||
msgid ""
|
||||
"Window %s sets an MWM hint indicating it isn't resizable, but sets min size %"
|
||||
|
1995
po/pt_BR.po
1995
po/pt_BR.po
File diff suppressed because it is too large
Load Diff
@ -186,9 +186,8 @@ else
|
||||
install-data-local:
|
||||
endif
|
||||
|
||||
IMAGES=default_icon.png stock_maximize.png stock_minimize.png stock_delete.png
|
||||
VARIABLES=default_icon_data $(srcdir)/default_icon.png \
|
||||
stock_maximize_data $(srcdir)/stock_maximize.png \
|
||||
IMAGES=stock_maximize.png stock_minimize.png stock_delete.png
|
||||
VARIABLES=stock_maximize_data $(srcdir)/stock_maximize.png \
|
||||
stock_minimize_data $(srcdir)/stock_minimize.png \
|
||||
stock_delete_data $(srcdir)/stock_delete.png
|
||||
|
||||
|
@ -234,6 +234,11 @@ static void handle_move_to_corner_se (MetaDisplay *display,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_move_to_center (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding);
|
||||
static void handle_spew_mark (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
@ -489,6 +494,7 @@ static const MetaKeyHandler window_handlers[] = {
|
||||
{ META_KEYBINDING_MOVE_TO_CORNER_NE, handle_move_to_corner_ne, NULL },
|
||||
{ META_KEYBINDING_MOVE_TO_CORNER_SW, handle_move_to_corner_sw, NULL },
|
||||
{ META_KEYBINDING_MOVE_TO_CORNER_SE, handle_move_to_corner_se, NULL },
|
||||
{ META_KEYBINDING_MOVE_TO_CENTER, handle_move_to_center, NULL },
|
||||
{ NULL, NULL, NULL }
|
||||
};
|
||||
|
||||
@ -3037,6 +3043,36 @@ handle_move_to_side_w (MetaDisplay *display,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
handle_move_to_center (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
MetaWindow *window,
|
||||
XEvent *event,
|
||||
MetaKeyBinding *binding)
|
||||
{
|
||||
MetaRectangle work_area;
|
||||
MetaRectangle outer;
|
||||
int orig_x, orig_y;
|
||||
int frame_width, frame_height;
|
||||
|
||||
if (!window)
|
||||
return;
|
||||
|
||||
meta_window_get_work_area_all_xineramas (window, &work_area);
|
||||
meta_window_get_outer_rect (window, &outer);
|
||||
meta_window_get_position (window, &orig_x, &orig_y);
|
||||
|
||||
frame_width = (window->frame ? window->frame->child_x : 0);
|
||||
frame_height = (window->frame ? window->frame->child_y : 0);
|
||||
|
||||
meta_window_move_resize (window,
|
||||
TRUE,
|
||||
work_area.x + (work_area.width +frame_width -outer.width )/2,
|
||||
work_area.y + (work_area.height+frame_height-outer.height)/2,
|
||||
window->rect.width,
|
||||
window->rect.height);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
process_workspace_switch_grab (MetaDisplay *display,
|
||||
MetaScreen *screen,
|
||||
|
@ -1,6 +1,11 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity Keybindings */
|
||||
/**
|
||||
* \file keybindings.h Grab and ungrab keys, and process the key events
|
||||
*
|
||||
* Performs global X grabs on the keys we need to be told about, like
|
||||
* the one to close a window. It also deals with incoming key events.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
|
@ -23,14 +23,15 @@
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file core/main.c Program startup
|
||||
*
|
||||
* \file
|
||||
* Program startup.
|
||||
* Functions which parse the command-line arguments, create the display,
|
||||
* kick everything off and then close down Metacity when it's time to go.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \mainpage Metacity - a boring window manager for the adult in you
|
||||
* \mainpage
|
||||
* Metacity - a boring window manager for the adult in you
|
||||
*
|
||||
* Many window managers are like Marshmallow Froot Loops; Metacity
|
||||
* is like Cheerios.
|
||||
@ -216,8 +217,17 @@ typedef struct
|
||||
gboolean disable_sm;
|
||||
gboolean print_version;
|
||||
gboolean sync;
|
||||
gboolean composite;
|
||||
gboolean no_composite;
|
||||
} MetaArguments;
|
||||
|
||||
#ifdef HAVE_COMPOSITE_EXTENSIONS
|
||||
#define COMPOSITE_OPTS_FLAGS 0
|
||||
#else /* HAVE_COMPOSITE_EXTENSIONS */
|
||||
/* No compositor, so don't show the arguments in --help */
|
||||
#define COMPOSITE_OPTS_FLAGS G_OPTION_FLAG_HIDDEN
|
||||
#endif /* HAVE_COMPOSITE_EXTENSIONS */
|
||||
|
||||
/**
|
||||
* Parses argc and argv and returns the
|
||||
* arguments that Metacity understands in meta_args.
|
||||
@ -234,7 +244,8 @@ static void
|
||||
meta_parse_options (int *argc, char ***argv,
|
||||
MetaArguments *meta_args)
|
||||
{
|
||||
MetaArguments my_args = {NULL, NULL, NULL, FALSE, FALSE, FALSE};
|
||||
MetaArguments my_args = {NULL, NULL, NULL,
|
||||
FALSE, FALSE, FALSE, FALSE, FALSE};
|
||||
GOptionEntry options[] = {
|
||||
{
|
||||
"sm-disable", 0, 0, G_OPTION_ARG_NONE,
|
||||
@ -255,7 +266,7 @@ meta_parse_options (int *argc, char ***argv,
|
||||
"ID"
|
||||
},
|
||||
{
|
||||
"display", 0, 0, G_OPTION_ARG_STRING,
|
||||
"display", 'd', 0, G_OPTION_ARG_STRING,
|
||||
&my_args.display_name, N_("X Display to use"),
|
||||
"DISPLAY"
|
||||
},
|
||||
@ -277,6 +288,18 @@ meta_parse_options (int *argc, char ***argv,
|
||||
N_("Make X calls synchronous"),
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"composite", 'c', COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE,
|
||||
&my_args.composite,
|
||||
N_("Turn compositing on"),
|
||||
NULL
|
||||
},
|
||||
{
|
||||
"no-composite", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE,
|
||||
&my_args.no_composite,
|
||||
N_("Turn compositing off"),
|
||||
NULL
|
||||
},
|
||||
{NULL}
|
||||
};
|
||||
GOptionContext *ctx;
|
||||
@ -472,7 +495,10 @@ main (int argc, char **argv)
|
||||
g_free (meta_args.save_file);
|
||||
g_free (meta_args.display_name);
|
||||
g_free (meta_args.client_id);
|
||||
|
||||
|
||||
if (meta_args.composite || meta_args.no_composite)
|
||||
meta_prefs_set_compositing_manager (meta_args.composite);
|
||||
|
||||
if (!meta_display_open ())
|
||||
meta_exit (META_EXIT_ERROR);
|
||||
|
||||
|
@ -1,6 +1,14 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* $Xorg: Xatomtype.h,v 1.4 2001/02/09 02:03:38 xorgcvs Exp $ */
|
||||
/**
|
||||
* \file metacity-Xatomtype.h Types for communicating with X about properties
|
||||
*
|
||||
* This files defines crock C structures for calling XGetWindowProperty and
|
||||
* XChangeProperty. All fields must be longs as the semantics of property
|
||||
* routines will handle conversion to and from actual 32 bit objects. If your
|
||||
* compiler doesn't treat &structoflongs the same as &arrayoflongs[0], you
|
||||
* will have some work to do.
|
||||
*/
|
||||
|
||||
/***********************************************************
|
||||
|
||||
@ -52,14 +60,6 @@ SOFTWARE.
|
||||
#ifndef _XATOMTYPE_H_
|
||||
#define _XATOMTYPE_H_
|
||||
|
||||
/*
|
||||
* This files defines crock C structures for calling XGetWindowProperty and
|
||||
* XChangeProperty. All fields must be longs as the semantics of property
|
||||
* routines will handle conversion to and from actual 32 bit objects. If your
|
||||
* compiler doesn't treat &structoflongs the same as &arrayoflongs[0], you
|
||||
* will have some work to do.
|
||||
*/
|
||||
|
||||
#define BOOL long
|
||||
#define SIGNEDINT long
|
||||
#define UNSIGNEDINT unsigned long
|
||||
|
@ -49,6 +49,7 @@
|
||||
*/
|
||||
#define KEY_TITLEBAR_FONT "/apps/metacity/general/titlebar_font"
|
||||
#define KEY_NUM_WORKSPACES "/apps/metacity/general/num_workspaces"
|
||||
#define KEY_COMPOSITOR "/apps/metacity/general/compositing_manager"
|
||||
#define KEY_GNOME_ACCESSIBILITY "/desktop/gnome/interface/accessibility"
|
||||
|
||||
#define KEY_COMMAND_PREFIX "/apps/metacity/keybinding_commands/command_"
|
||||
@ -1928,6 +1929,7 @@ static MetaKeyPref window_bindings[] = {
|
||||
{ META_KEYBINDING_MOVE_TO_SIDE_S, NULL, FALSE },
|
||||
{ META_KEYBINDING_MOVE_TO_SIDE_E, NULL, FALSE },
|
||||
{ META_KEYBINDING_MOVE_TO_SIDE_W, NULL, FALSE },
|
||||
{ META_KEYBINDING_MOVE_TO_CENTER, NULL, FALSE },
|
||||
{ NULL, NULL, FALSE }
|
||||
};
|
||||
|
||||
@ -2944,6 +2946,24 @@ meta_prefs_get_compositing_manager (void)
|
||||
return compositing_manager;
|
||||
}
|
||||
|
||||
void
|
||||
meta_prefs_set_compositing_manager (gboolean whether)
|
||||
{
|
||||
GError *err = NULL;
|
||||
|
||||
gconf_client_set_bool (default_client,
|
||||
KEY_COMPOSITOR,
|
||||
whether,
|
||||
&err);
|
||||
|
||||
if (err)
|
||||
{
|
||||
meta_warning (_("Error setting compositor status: %s\n"),
|
||||
err->message);
|
||||
g_error_free (err);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef HAVE_GCONF
|
||||
static void
|
||||
init_button_layout(void)
|
||||
|
@ -1,6 +1,13 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity X screen handler */
|
||||
/**
|
||||
* \file screen-private.h Screens which Metacity manages
|
||||
*
|
||||
* Managing X screens.
|
||||
* This file contains methods on this class which are available to
|
||||
* routines in core but not outside it. (See screen.h for the routines
|
||||
* which the rest of the world is allowed to use.)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
|
@ -1,6 +1,13 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity Session Management */
|
||||
/**
|
||||
* \file session.h Session management
|
||||
*
|
||||
* Maps windows to information about their placing and state on startup.
|
||||
* This is window matching, which we have a policy of leaving in general
|
||||
* to programs such as Devil's Pie, but the session manager specification
|
||||
* requires us to do it here.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
|
@ -1,6 +1,13 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity X managed windows */
|
||||
/**
|
||||
* \file window-private.h Windows which Metacity manages
|
||||
*
|
||||
* Managing X windows.
|
||||
* This file contains methods on this class which are available to
|
||||
* routines in core but not outside it. (See window.h for the routines
|
||||
* which the rest of the world is allowed to use.)
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
|
@ -1,7 +1,7 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/**
|
||||
* \file window-props.c MetaWindow property handling
|
||||
* \file window-props.h MetaWindow property handling
|
||||
*
|
||||
* A system which can inspect sets of properties of given windows
|
||||
* and take appropriate action given their values.
|
||||
|
@ -75,7 +75,8 @@ static void meta_window_show (MetaWindow *window);
|
||||
static void meta_window_hide (MetaWindow *window);
|
||||
|
||||
static void meta_window_save_rect (MetaWindow *window);
|
||||
static void meta_window_save_user_rect (MetaWindow *window);
|
||||
static void save_user_window_placement (MetaWindow *window);
|
||||
static void force_save_user_window_placement (MetaWindow *window);
|
||||
|
||||
static void meta_window_move_resize_internal (MetaWindow *window,
|
||||
MetaMoveResizeFlags flags,
|
||||
@ -2457,11 +2458,28 @@ meta_window_save_rect (MetaWindow *window)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the user_rect regardless of whether the window is maximized or
|
||||
* fullscreen. See save_user_window_placement() for most uses.
|
||||
*
|
||||
* \param window Store current position of this window for future reference
|
||||
*/
|
||||
static void
|
||||
meta_window_save_user_rect (MetaWindow *window)
|
||||
force_save_user_window_placement (MetaWindow *window)
|
||||
{
|
||||
meta_window_get_client_root_coords (window, &window->user_rect);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save the user_rect, but only if the window is neither maximized nor
|
||||
* fullscreen, otherwise the window may snap back to those dimensions
|
||||
* (bug #461927).
|
||||
*
|
||||
* \param window Store current position of this window for future reference
|
||||
*/
|
||||
static void
|
||||
save_user_window_placement (MetaWindow *window)
|
||||
{
|
||||
/* We do not save maximized or fullscreen dimensions, otherwise the
|
||||
* window may snap back to those dimensions (Bug #461927). */
|
||||
if (!(META_WINDOW_MAXIMIZED (window) || window->fullscreen))
|
||||
{
|
||||
MetaRectangle user_rect;
|
||||
@ -3527,13 +3545,11 @@ meta_window_move_resize_internal (MetaWindow *window,
|
||||
if (need_configure_notify)
|
||||
send_configure_notify (window);
|
||||
|
||||
/* user_rect is the position to restore towards if strut changes occur. Thus
|
||||
* we want user_rect to reflect user position/size changes OR the initial
|
||||
* placement of the window.
|
||||
*/
|
||||
if (is_user_action || !window->placed)
|
||||
meta_window_save_user_rect(window);
|
||||
|
||||
if (!window->placed)
|
||||
force_save_user_window_placement (window);
|
||||
else if (is_user_action)
|
||||
save_user_window_placement (window);
|
||||
|
||||
if (need_move_frame || need_resize_frame ||
|
||||
need_move_client || need_resize_client)
|
||||
{
|
||||
@ -4575,7 +4591,7 @@ meta_window_move_resize_request (MetaWindow *window,
|
||||
*
|
||||
* See also bug 426519.
|
||||
*/
|
||||
meta_window_save_user_rect(window);
|
||||
save_user_window_placement (window);
|
||||
}
|
||||
|
||||
gboolean
|
||||
@ -5329,18 +5345,25 @@ process_property_notify (MetaWindow *window,
|
||||
* can just call reload on the property in the event and get rid of
|
||||
* this if-else chain.
|
||||
*/
|
||||
|
||||
|
||||
if (meta_is_verbose ()) /* avoid looking up the name if we don't have to */
|
||||
{
|
||||
char *property_name = XGetAtomName (window->display->xdisplay,
|
||||
event->atom);
|
||||
|
||||
meta_verbose ("Property notify on %s for %s\n",
|
||||
window->desc, property_name);
|
||||
XFree (property_name);
|
||||
}
|
||||
|
||||
if (event->atom == XA_WM_NAME)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_NAME\n", window->desc);
|
||||
|
||||
/* don't bother reloading WM_NAME if using _NET_WM_NAME already */
|
||||
if (!window->using_net_wm_name)
|
||||
meta_window_reload_property (window, XA_WM_NAME);
|
||||
}
|
||||
else if (event->atom == window->display->atom__NET_WM_NAME)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for NET_WM_NAME\n", window->desc);
|
||||
meta_window_reload_property (window, window->display->atom__NET_WM_NAME);
|
||||
|
||||
/* if _NET_WM_NAME was unset, reload WM_NAME */
|
||||
@ -5349,15 +5372,12 @@ process_property_notify (MetaWindow *window,
|
||||
}
|
||||
else if (event->atom == XA_WM_ICON_NAME)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_ICON_NAME\n", window->desc);
|
||||
|
||||
/* don't bother reloading WM_ICON_NAME if using _NET_WM_ICON_NAME already */
|
||||
if (!window->using_net_wm_icon_name)
|
||||
meta_window_reload_property (window, XA_WM_ICON_NAME);
|
||||
}
|
||||
else if (event->atom == window->display->atom__NET_WM_ICON_NAME)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for NET_WM_ICON_NAME\n", window->desc);
|
||||
meta_window_reload_property (window, window->display->atom__NET_WM_ICON_NAME);
|
||||
|
||||
/* if _NET_WM_ICON_NAME was unset, reload WM_ICON_NAME */
|
||||
@ -5366,8 +5386,6 @@ process_property_notify (MetaWindow *window,
|
||||
}
|
||||
else if (event->atom == XA_WM_NORMAL_HINTS)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_NORMAL_HINTS\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window, XA_WM_NORMAL_HINTS);
|
||||
|
||||
/* See if we need to constrain current size */
|
||||
@ -5375,40 +5393,28 @@ process_property_notify (MetaWindow *window,
|
||||
}
|
||||
else if (event->atom == window->display->atom_WM_PROTOCOLS)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_PROTOCOLS\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window, window->display->atom_WM_PROTOCOLS);
|
||||
}
|
||||
else if (event->atom == XA_WM_HINTS)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_HINTS\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window, XA_WM_HINTS);
|
||||
}
|
||||
else if (event->atom == window->display->atom__MOTIF_WM_HINTS)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for MOTIF_WM_HINTS\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window,
|
||||
window->display->atom__MOTIF_WM_HINTS);
|
||||
}
|
||||
else if (event->atom == XA_WM_CLASS)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_CLASS\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window, XA_WM_CLASS);
|
||||
}
|
||||
else if (event->atom == XA_WM_TRANSIENT_FOR)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_TRANSIENT_FOR\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window, XA_WM_TRANSIENT_FOR);
|
||||
}
|
||||
else if (event->atom ==
|
||||
window->display->atom_WM_WINDOW_ROLE)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for WM_WINDOW_ROLE\n", window->desc);
|
||||
|
||||
update_role (window);
|
||||
}
|
||||
else if (event->atom ==
|
||||
@ -5421,12 +5427,10 @@ process_property_notify (MetaWindow *window,
|
||||
else if (event->atom ==
|
||||
window->display->atom__NET_WM_WINDOW_TYPE)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for NET_WM_WINDOW_TYPE\n", window->desc);
|
||||
update_net_wm_type (window);
|
||||
}
|
||||
else if (event->atom == window->display->atom__NET_WM_ICON)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for NET_WM_ICON\n", window->desc);
|
||||
meta_icon_cache_property_changed (&window->icon_cache,
|
||||
window->display,
|
||||
event->atom);
|
||||
@ -5434,8 +5438,6 @@ process_property_notify (MetaWindow *window,
|
||||
}
|
||||
else if (event->atom == window->display->atom__KWM_WIN_ICON)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for KWM_WIN_ICON\n", window->desc);
|
||||
|
||||
meta_icon_cache_property_changed (&window->icon_cache,
|
||||
window->display,
|
||||
event->atom);
|
||||
@ -5444,20 +5446,15 @@ process_property_notify (MetaWindow *window,
|
||||
else if ((event->atom == window->display->atom__NET_WM_STRUT) ||
|
||||
(event->atom == window->display->atom__NET_WM_STRUT_PARTIAL))
|
||||
{
|
||||
meta_verbose ("Property notify on %s for _NET_WM_STRUT\n", window->desc);
|
||||
meta_window_update_struts (window);
|
||||
}
|
||||
else if (event->atom == window->display->atom__NET_STARTUP_ID)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for _NET_STARTUP_ID\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window,
|
||||
window->display->atom__NET_STARTUP_ID);
|
||||
}
|
||||
else if (event->atom == window->display->atom__NET_WM_SYNC_REQUEST_COUNTER)
|
||||
{
|
||||
meta_verbose ("Property notify on %s for _NET_WM_SYNC_REQUEST_COUNTER\n", window->desc);
|
||||
|
||||
meta_window_reload_property (window,
|
||||
window->display->atom__NET_WM_SYNC_REQUEST_COUNTER);
|
||||
}
|
||||
@ -5466,8 +5463,6 @@ process_property_notify (MetaWindow *window,
|
||||
Window xid;
|
||||
Atom atom__NET_WM_USER_TIME;
|
||||
|
||||
meta_verbose ("Property notify on %s for _NET_WM_USER_TIME\n", window->desc);
|
||||
|
||||
atom__NET_WM_USER_TIME = window->display->atom__NET_WM_USER_TIME;
|
||||
if (window->user_time_window)
|
||||
xid = window->user_time_window;
|
||||
|
@ -35,6 +35,9 @@ static void set_active_space_hint (MetaScreen *screen);
|
||||
static void focus_ancestor_or_mru_window (MetaWorkspace *workspace,
|
||||
MetaWindow *not_this_one,
|
||||
guint32 timestamp);
|
||||
static void free_this (gpointer candidate,
|
||||
gpointer dummy);
|
||||
static void workspace_free_struts (MetaWorkspace *workspace);
|
||||
|
||||
static void
|
||||
maybe_add_to_list (MetaScreen *screen, MetaWindow *window, gpointer data)
|
||||
@ -79,6 +82,29 @@ meta_workspace_new (MetaScreen *screen)
|
||||
return workspace;
|
||||
}
|
||||
|
||||
/** Foreach function for workspace_free_struts() */
|
||||
static void
|
||||
free_this (gpointer candidate, gpointer dummy)
|
||||
{
|
||||
g_free (candidate);
|
||||
}
|
||||
|
||||
/**
|
||||
* Frees the struts list of a workspace.
|
||||
*
|
||||
* \param workspace The workspace.
|
||||
*/
|
||||
static void
|
||||
workspace_free_struts (MetaWorkspace *workspace)
|
||||
{
|
||||
if (workspace->all_struts == NULL)
|
||||
return;
|
||||
|
||||
g_slist_foreach (workspace->all_struts, free_this, NULL);
|
||||
g_slist_free (workspace->all_struts);
|
||||
workspace->all_struts = NULL;
|
||||
}
|
||||
|
||||
void
|
||||
meta_workspace_free (MetaWorkspace *workspace)
|
||||
{
|
||||
@ -127,7 +153,7 @@ meta_workspace_free (MetaWorkspace *workspace)
|
||||
|
||||
if (!workspace->work_areas_invalid)
|
||||
{
|
||||
g_slist_free (workspace->all_struts);
|
||||
workspace_free_struts (workspace);
|
||||
for (i = 0; i < screen->n_xinerama_infos; i++)
|
||||
meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]);
|
||||
g_free (workspace->xinerama_region);
|
||||
@ -457,8 +483,7 @@ meta_workspace_invalidate_work_area (MetaWorkspace *workspace)
|
||||
g_free (workspace->work_area_xinerama);
|
||||
workspace->work_area_xinerama = NULL;
|
||||
|
||||
g_slist_free (workspace->all_struts);
|
||||
workspace->all_struts = NULL;
|
||||
workspace_free_struts (workspace);
|
||||
|
||||
for (i = 0; i < workspace->screen->n_xinerama_infos; i++)
|
||||
meta_rectangle_free_list_and_elements (workspace->xinerama_region[i]);
|
||||
@ -514,9 +539,12 @@ ensure_work_areas_validated (MetaWorkspace *workspace)
|
||||
MetaWindow *win = tmp->data;
|
||||
GSList *s_iter;
|
||||
|
||||
for (s_iter = win->struts; s_iter != NULL; s_iter = s_iter->next)
|
||||
for (s_iter = win->struts; s_iter != NULL; s_iter = s_iter->next) {
|
||||
MetaStrut *cpy = g_new (MetaStrut, 1);
|
||||
*cpy = *((MetaStrut *)s_iter->data);
|
||||
workspace->all_struts = g_slist_prepend (workspace->all_struts,
|
||||
s_iter->data);
|
||||
cpy);
|
||||
}
|
||||
}
|
||||
g_list_free (windows);
|
||||
|
||||
|
@ -1,6 +1,14 @@
|
||||
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
|
||||
|
||||
/* Metacity Workspaces */
|
||||
/**
|
||||
* \file workspace.h Workspaces
|
||||
*
|
||||
* A workspace is a set of windows which all live on the same
|
||||
* screen. (You may also see the name "desktop" around the place,
|
||||
* which is the EWMH's name for the same thing.) Only one workspace
|
||||
* of a screen may be active at once; all windows on all other workspaces
|
||||
* are unmapped.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2001 Havoc Pennington
|
||||
|
@ -278,6 +278,8 @@ struct _MetaButtonLayout
|
||||
#define META_MINI_ICON_WIDTH 16
|
||||
#define META_MINI_ICON_HEIGHT 16
|
||||
|
||||
#define META_DEFAULT_ICON_NAME "window"
|
||||
|
||||
#define META_PRIORITY_PREFS_NOTIFY (G_PRIORITY_DEFAULT_IDLE + 10)
|
||||
#define META_PRIORITY_WORK_AREA_HINT (G_PRIORITY_DEFAULT_IDLE + 15)
|
||||
|
||||
|
@ -113,6 +113,13 @@ const char* meta_prefs_get_cursor_theme (void);
|
||||
int meta_prefs_get_cursor_size (void);
|
||||
gboolean meta_prefs_get_compositing_manager (void);
|
||||
|
||||
/**
|
||||
* Sets whether the compositor is turned on.
|
||||
*
|
||||
* \param whether TRUE to turn on, FALSE to turn off
|
||||
*/
|
||||
void meta_prefs_set_compositing_manager (gboolean whether);
|
||||
|
||||
/* Screen bindings */
|
||||
#define META_KEYBINDING_WORKSPACE_1 "switch_to_workspace_1"
|
||||
#define META_KEYBINDING_WORKSPACE_2 "switch_to_workspace_2"
|
||||
@ -224,6 +231,7 @@ gboolean meta_prefs_get_compositing_manager (void);
|
||||
#define META_KEYBINDING_MOVE_TO_SIDE_S "move_to_side_s"
|
||||
#define META_KEYBINDING_MOVE_TO_SIDE_E "move_to_side_e"
|
||||
#define META_KEYBINDING_MOVE_TO_SIDE_W "move_to_side_w"
|
||||
#define META_KEYBINDING_MOVE_TO_CENTER "move_to_center"
|
||||
|
||||
typedef enum _MetaKeyBindingAction
|
||||
{
|
||||
|
@ -1329,6 +1329,30 @@ you set
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<schema>
|
||||
<key>/schemas/apps/metacity/window_keybindings/move_to_center</key>
|
||||
<applyto>/apps/metacity/window_keybindings/move_to_center</applyto>
|
||||
<owner>metacity</owner>
|
||||
<type>string</type>
|
||||
<!-- no default for this one -->
|
||||
<locale name="C">
|
||||
<short>Move window to center of screen</short>
|
||||
<long>
|
||||
This keybinding moves a window into the center
|
||||
of the screen.
|
||||
|
||||
The format looks like "<Control>a" or
|
||||
"<Shift><Alt>F1".
|
||||
|
||||
The parser is fairly liberal and allows lower or upper case,
|
||||
and also abbreviations such as "<Ctl>" and
|
||||
"<Ctrl>". If you set the option to the special string
|
||||
"disabled", then there will be no keybinding for this
|
||||
action.
|
||||
</long>
|
||||
</locale>
|
||||
</schema>
|
||||
|
||||
<!-- Global Keybindings -->
|
||||
|
||||
|
||||
|
@ -25,6 +25,7 @@
|
||||
#define _XOPEN_SOURCE 600 /* for the maths routines over floats */
|
||||
|
||||
#include <math.h>
|
||||
#include <gtk/gtkicontheme.h>
|
||||
#include "preview-widget.h"
|
||||
|
||||
static void meta_preview_class_init (MetaPreviewClass *klass);
|
||||
@ -411,8 +412,6 @@ meta_preview_set_button_layout (MetaPreview *preview,
|
||||
gtk_widget_queue_draw (GTK_WIDGET (preview));
|
||||
}
|
||||
|
||||
#include "inlinepixbufs.h"
|
||||
|
||||
GdkPixbuf*
|
||||
meta_preview_get_icon (void)
|
||||
{
|
||||
@ -420,20 +419,27 @@ meta_preview_get_icon (void)
|
||||
|
||||
if (default_icon == NULL)
|
||||
{
|
||||
GdkPixbuf *base;
|
||||
GtkIconTheme *theme;
|
||||
gboolean icon_exists;
|
||||
|
||||
base = gdk_pixbuf_new_from_inline (-1, default_icon_data,
|
||||
FALSE,
|
||||
NULL);
|
||||
theme = gtk_icon_theme_get_default ();
|
||||
|
||||
g_assert (base);
|
||||
icon_exists = gtk_icon_theme_has_icon (theme, META_DEFAULT_ICON_NAME);
|
||||
|
||||
default_icon = gdk_pixbuf_scale_simple (base,
|
||||
META_ICON_WIDTH,
|
||||
META_ICON_HEIGHT,
|
||||
GDK_INTERP_BILINEAR);
|
||||
if (icon_exists)
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
META_DEFAULT_ICON_NAME,
|
||||
META_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
else
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
"gtk-missing-image",
|
||||
META_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
g_object_unref (G_OBJECT (base));
|
||||
g_assert (default_icon);
|
||||
}
|
||||
|
||||
return default_icon;
|
||||
@ -446,20 +452,27 @@ meta_preview_get_mini_icon (void)
|
||||
|
||||
if (default_icon == NULL)
|
||||
{
|
||||
GdkPixbuf *base;
|
||||
GtkIconTheme *theme;
|
||||
gboolean icon_exists;
|
||||
|
||||
base = gdk_pixbuf_new_from_inline (-1, default_icon_data,
|
||||
FALSE,
|
||||
NULL);
|
||||
theme = gtk_icon_theme_get_default ();
|
||||
|
||||
g_assert (base);
|
||||
icon_exists = gtk_icon_theme_has_icon (theme, META_DEFAULT_ICON_NAME);
|
||||
|
||||
default_icon = gdk_pixbuf_scale_simple (base,
|
||||
META_MINI_ICON_WIDTH,
|
||||
META_MINI_ICON_HEIGHT,
|
||||
GDK_INTERP_BILINEAR);
|
||||
if (icon_exists)
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
META_DEFAULT_ICON_NAME,
|
||||
META_MINI_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
else
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
"gtk-missing-image",
|
||||
META_MINI_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
g_object_unref (G_OBJECT (base));
|
||||
g_assert (default_icon);
|
||||
}
|
||||
|
||||
return default_icon;
|
||||
|
54
src/ui/ui.c
54
src/ui/ui.c
@ -591,20 +591,27 @@ meta_ui_get_default_window_icon (MetaUI *ui)
|
||||
|
||||
if (default_icon == NULL)
|
||||
{
|
||||
GdkPixbuf *base;
|
||||
GtkIconTheme *theme;
|
||||
gboolean icon_exists;
|
||||
|
||||
base = gdk_pixbuf_new_from_inline (-1, default_icon_data,
|
||||
FALSE,
|
||||
NULL);
|
||||
theme = gtk_icon_theme_get_default ();
|
||||
|
||||
g_assert (base);
|
||||
icon_exists = gtk_icon_theme_has_icon (theme, META_DEFAULT_ICON_NAME);
|
||||
|
||||
default_icon = gdk_pixbuf_scale_simple (base,
|
||||
META_ICON_WIDTH,
|
||||
META_ICON_HEIGHT,
|
||||
GDK_INTERP_BILINEAR);
|
||||
if (icon_exists)
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
META_DEFAULT_ICON_NAME,
|
||||
META_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
else
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
"gtk-missing-image",
|
||||
META_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
g_object_unref (G_OBJECT (base));
|
||||
g_assert (default_icon);
|
||||
}
|
||||
|
||||
g_object_ref (G_OBJECT (default_icon));
|
||||
@ -619,20 +626,27 @@ meta_ui_get_default_mini_icon (MetaUI *ui)
|
||||
|
||||
if (default_icon == NULL)
|
||||
{
|
||||
GdkPixbuf *base;
|
||||
GtkIconTheme *theme;
|
||||
gboolean icon_exists;
|
||||
|
||||
base = gdk_pixbuf_new_from_inline (-1, default_icon_data,
|
||||
FALSE,
|
||||
NULL);
|
||||
theme = gtk_icon_theme_get_default ();
|
||||
|
||||
g_assert (base);
|
||||
icon_exists = gtk_icon_theme_has_icon (theme, META_DEFAULT_ICON_NAME);
|
||||
|
||||
default_icon = gdk_pixbuf_scale_simple (base,
|
||||
META_MINI_ICON_WIDTH,
|
||||
META_MINI_ICON_HEIGHT,
|
||||
GDK_INTERP_BILINEAR);
|
||||
if (icon_exists)
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
META_DEFAULT_ICON_NAME,
|
||||
META_MINI_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
else
|
||||
default_icon = gtk_icon_theme_load_icon (theme,
|
||||
"gtk-missing-image",
|
||||
META_MINI_ICON_WIDTH,
|
||||
0,
|
||||
NULL);
|
||||
|
||||
g_object_unref (G_OBJECT (base));
|
||||
g_assert (default_icon);
|
||||
}
|
||||
|
||||
g_object_ref (G_OBJECT (default_icon));
|
||||
|
Loading…
Reference in New Issue
Block a user