1 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/Makefile.am gnome-control-center-2.23.4/capplets/appearance/Makefile.am 2 --- ../gnome-control-center-2.23.4/capplets/appearance/Makefile.am 2008-07-02 14:32:05.976202487 +0200 3 +++ gnome-control-center-2.23.4/capplets/appearance/Makefile.am 2008-07-02 14:32:20.885276303 +0200 4 @@ -9,6 +9,8 @@ gnome_appearance_properties_SOURCES = \ 5 appearance.h \ 6 appearance-desktop.c \ 7 appearance-desktop.h \ 8 + appearance-effects.c\ 9 + appearance-effects.h\ 10 appearance-font.c \ 11 appearance-font.h \ 12 appearance-main.c \ 13 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/appearance-effects.c gnome-control-center-2.23.4/capplets/appearance/appearance-effects.c 14 --- ../gnome-control-center-2.23.4/capplets/appearance/appearance-effects.c 1970-01-01 01:00:00.000000000 +0100 15 +++ gnome-control-center-2.23.4/capplets/appearance/appearance-effects.c 2008-07-02 14:32:20.886502301 +0200 16 @@ -0,0 +1,1225 @@ 17 +/* 18 + * Copyright (C) 2007 Canonical 19 + * Written by Michael Vogt <mvo (a] ubuntu.com> 20 + * and Mirco Mller <mirco (a] ubuntu.com> 21 + * All Rights Reserved 22 + * 23 + * Based on desktop-effects.c: 24 + * Desktop Effects. A preference panel for compiz. 25 + * Copyright (C) 2006 Red Hat, Inc. 26 + * Author: Soren Sandmann (sandmann (a] redhat.com) * 27 + * 28 + * This program is free software; you can redistribute it and/or modify 29 + * it under the terms of the GNU General Public License as published by 30 + * the Free Software Foundation; either version 2 of the License, or 31 + * (at your option) any later version. 32 + * 33 + * This program is distributed in the hope that it will be useful, 34 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 35 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 36 + * GNU General Public License for more details. 37 + * 38 + * You should have received a copy of the GNU General Public License along 39 + * with this program; if not, write to the Free Software Foundation, Inc., 40 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 41 + */ 42 + 43 +#include <glib.h> 44 +#include <glib/gstdio.h> 45 +#include <X11/Xlib.h> 46 +#include <X11/Xatom.h> 47 +#include <gdk/gdkx.h> 48 +#include <X11/extensions/Xcomposite.h> 49 +#include <math.h> 50 + 51 +#include "appearance.h" 52 + 53 +#include "gconf-property-editor.h" 54 + 55 +typedef enum { 56 + COMPIZ, 57 + METACITY 58 +} WindowManager; 59 + 60 +#define WINDOW_MANAGER_KEY "/apps/gnome-session/gnome-wm/preferred_window_manager" 61 +#define COMPIZ_BIN "/usr/bin/compiz" 62 +#define METACITY_BIN "/usr/bin/metacity" 63 +#define REVERT_COUNT 40 64 +#define SECONDS_WE_WILL_WAIT_FOR_COMPIZ_TO_START 8 65 +#define PLUGIN_LIST_KEY "/apps/compiz/general/allscreens/options/active_plugins" 66 +#define NUM_WORKSPACES "/apps/metacity/general/num_workspaces" 67 + 68 +/* helper structure to pass pager data around */ 69 +typedef struct _TraversalChunk { 70 + GConfClient *client; 71 + GArray *numRowsArray; 72 + gint rows; 73 +} TraversalChunk; 74 + 75 +/* possible effects level */ 76 +enum { 77 + NO_EFFECTS, 78 + NORMAL_EFFECTS, 79 + EXTRA_EFFECTS, 80 + CUSTOM_EFFECTS 81 +}; 82 + 83 +/* radio-button names in glade-file */ 84 +static const char *effect_choices[] = { 85 + "no_effects_button", 86 + "normal_effects_button", 87 + "extra_effects_button", 88 + "custom_effects_button" 89 +}; 90 + 91 +/* plugin-set for extra-effects level */ 92 +static const gchar* extra_effects[] = { 93 + 94 +"dbus", 95 +"move", 96 +"place", 97 +"png", 98 +"regex", 99 +"resize", 100 +"svg", 101 +"water", 102 +"imgjpeg", 103 +"mousepoll", 104 +"resizeinfo", 105 +"session", 106 +"text", 107 +"thumbnail", 108 +"workarounds", 109 +"firepaint", 110 +"shelf", 111 +"decoration", 112 +"wobbly", 113 +"animation", 114 +"shift", 115 +"fade", 116 +"group", 117 +"cube", 118 +"rotate", 119 +"scale", 120 +"3d", 121 +"cubeaddon", 122 +"scalefilter", 123 +"expo", 124 +"ezoom", 125 +NULL 126 +}; 127 + 128 +static gboolean 129 +check_compiz (void) 130 +{ 131 + return g_file_test ("/usr/bin/compiz", G_FILE_TEST_IS_EXECUTABLE); 132 +} 133 + 134 +static gboolean 135 +check_ccsm (void) 136 +{ 137 + return g_file_test ("/usr/bin/ccsm", G_FILE_TEST_IS_EXECUTABLE); 138 +} 139 +static void 140 +run_ccsm (GtkButton *widget, 141 + gpointer data) 142 +{ 143 + g_spawn_command_line_async ("/usr/bin/ccsm", NULL); 144 +} 145 +static gboolean 146 +check_compiz_configure (void) 147 +{ 148 + return g_file_test ("/usr/lib/compiz/compiz-configure", G_FILE_TEST_IS_EXECUTABLE); 149 +} 150 +static void 151 +run_compiz_configure (GtkButton *widget, 152 + gpointer data) 153 +{ 154 + g_spawn_command_line_async ("/usr/lib/compiz/compiz-configure", NULL); 155 +} 156 + 157 + 158 +static GSList * 159 +get_plugins (AppearanceData *app, 160 + GError **err) 161 +{ 162 + return gconf_client_get_list (app->client, 163 + PLUGIN_LIST_KEY, 164 + GCONF_VALUE_STRING, 165 + err); 166 +} 167 + 168 +static gboolean 169 +contains_string (GSList *plugins, 170 + const gchar *needle) 171 +{ 172 + GSList *slist; 173 + 174 + for (slist = plugins; slist != NULL; slist = slist->next) 175 + { 176 + const char *s = slist->data; 177 + 178 + if (s && strcmp (s, needle) == 0) 179 + return TRUE; 180 + } 181 + 182 + return FALSE; 183 +} 184 + 185 + 186 +static void 187 +show_info (const char *text) 188 +{ 189 + GtkWidget *dialog; 190 + 191 + dialog = gtk_message_dialog_new (NULL, 192 + GTK_DIALOG_MODAL, 193 + GTK_MESSAGE_INFO, 194 + GTK_BUTTONS_OK, 195 + text); 196 + 197 + gtk_dialog_run (GTK_DIALOG (dialog)); 198 + gtk_widget_destroy (dialog); 199 +} 200 + 201 +static gchar* 202 +get_string_value (GConfClient* client, 203 + const gchar* key) 204 +{ 205 + gchar *value = NULL; 206 + GError *error = NULL; 207 + 208 + g_assert (client != NULL); 209 + g_assert (key != NULL); 210 + 211 + value = gconf_client_get_string (client, key, &error); 212 + if (error) 213 + return NULL; 214 + 215 + return value; 216 +} 217 + 218 +static gint 219 +get_int_value (GConfClient* client, 220 + const gchar* key) 221 +{ 222 + gint value = 0; 223 + GError* error = NULL; 224 + 225 + g_assert (client != NULL); 226 + g_assert (key != NULL); 227 + 228 + value = gconf_client_get_int (client, key, &error); 229 + if (error) 230 + return 0; 231 + 232 + return value; 233 +} 234 + 235 +static void 236 +check_for_wnck_entry (gpointer data, 237 + gpointer user_data) 238 +{ 239 + gchar *appletId = (gchar*) data; 240 + TraversalChunk *chunk = (TraversalChunk*) user_data; 241 + GString *propertyPath = NULL; 242 + gchar *value = NULL; 243 + gint rows = 0; 244 + gint position = 0; 245 + 246 + /* get bonobo-id of applet */ 247 + propertyPath = g_string_new ("/apps/panel/applets/"); 248 + propertyPath = g_string_append (propertyPath, appletId); 249 + propertyPath = g_string_append (propertyPath, "/bonobo_iid"); 250 + value = get_string_value (chunk->client, propertyPath->str); 251 + 252 + /* just exit if no bonobo-id was found */ 253 + if (!value) 254 + { 255 + g_string_free (propertyPath, TRUE); 256 + return; 257 + } 258 + 259 + /* test if it is actually a switcher */ 260 + if (!g_ascii_strncasecmp (value, 261 + "OAFIID:GNOME_WorkspaceSwitcherApplet", 262 + 36)) 263 + { 264 + /* assemble new gconf-path for num_rows gconf-key */ 265 + g_string_free (propertyPath, TRUE); 266 + propertyPath = g_string_new ("/apps/panel/applets/"); 267 + propertyPath = g_string_append (propertyPath, appletId); 268 + propertyPath = g_string_append (propertyPath, "/position"); 269 + 270 + /* get the value of position */ 271 + position = get_int_value (chunk->client, propertyPath->str); 272 + 273 + if (position > 1) 274 + { 275 + /* assemble new gconf-path for num_rows gconf-key */ 276 + g_string_free (propertyPath, TRUE); 277 + propertyPath = g_string_new ("/apps/panel/applets/"); 278 + propertyPath = g_string_append (propertyPath, appletId); 279 + propertyPath = g_string_append (propertyPath, 280 + "/prefs/num_rows"); 281 + 282 + /* get the value of rows */ 283 + rows = get_int_value (chunk->client, propertyPath->str); 284 + 285 + if (!chunk->numRowsArray) 286 + chunk->numRowsArray = g_array_new (TRUE, 287 + TRUE, 288 + sizeof (gint)); 289 + 290 + g_array_append_val (chunk->numRowsArray, rows); 291 + } 292 + } 293 + 294 + g_string_free (propertyPath, TRUE); 295 +} 296 + 297 +gboolean 298 +set_int_value (GConfClient *client, 299 + const gchar *key, 300 + gint value) 301 +{ 302 + gboolean result = FALSE; 303 + GError *error = NULL; 304 + 305 + g_assert (client != NULL); 306 + g_assert (key != NULL); 307 + 308 + result = gconf_client_set_int (client, 309 + key, 310 + value, 311 + &error); 312 + 313 + if (error) 314 + return FALSE; 315 + 316 + return result; 317 +} 318 + 319 +static void 320 +set_wnck_entry (gpointer data, 321 + gpointer user_data) 322 +{ 323 + gchar *appletId = (gchar*) data; 324 + TraversalChunk *chunk = (TraversalChunk*) user_data; 325 + GString *propertyPath = NULL; 326 + gchar *value = NULL; 327 + gint position = 0; 328 + 329 + /* get bonobo-id of applet */ 330 + propertyPath = g_string_new ("/apps/panel/applets/"); 331 + propertyPath = g_string_append (propertyPath, appletId); 332 + propertyPath = g_string_append (propertyPath, "/bonobo_iid"); 333 + value = get_string_value (chunk->client, propertyPath->str); 334 + 335 + /* just exit if no bonobo-id was found */ 336 + if (!value) 337 + { 338 + g_string_free (propertyPath, TRUE); 339 + return; 340 + } 341 + 342 + /* test if it is actually a switcher */ 343 + if (!g_ascii_strncasecmp (value, 344 + "OAFIID:GNOME_WorkspaceSwitcherApplet", 345 + 36)) 346 + { 347 + /* assemble new gconf-path for applets position gconf-key */ 348 + g_string_free (propertyPath, TRUE); 349 + propertyPath = g_string_new ("/apps/panel/applets/"); 350 + propertyPath = g_string_append (propertyPath, appletId); 351 + propertyPath = g_string_append (propertyPath, "/position"); 352 + 353 + /* get the value of position */ 354 + position = get_int_value (chunk->client, propertyPath->str); 355 + 356 + /* not the best way to test, if this applet is really active */ 357 + if (position > 1) 358 + { 359 + /* assemble new gconf-path for num_rows gconf-key */ 360 + g_string_free (propertyPath, TRUE); 361 + propertyPath = g_string_new ("/apps/panel/applets/"); 362 + propertyPath = g_string_append (propertyPath, appletId); 363 + propertyPath = g_string_append (propertyPath, 364 + "/prefs/num_rows"); 365 + 366 + /* set the value of rows */ 367 + set_int_value (chunk->client, 368 + propertyPath->str, 369 + chunk->rows); 370 + } 371 + } 372 + 373 + /* cleanup */ 374 + g_string_free (propertyPath, TRUE); 375 +} 376 + 377 +static gint 378 +get_pager_num_rows (GConfClient *client) 379 +{ 380 + GSList *idList = NULL; 381 + TraversalChunk *chunk = NULL; 382 + gint rows = 0; 383 + 384 + /* get ids of all used applets */ 385 + idList = gconf_client_get_list (client, 386 + "/apps/panel/general/applet_id_list", 387 + GCONF_VALUE_STRING, 388 + NULL); 389 + 390 + if (!idList) 391 + return 1; 392 + 393 + /* create and initialize helper-structure */ 394 + chunk = g_new0 (TraversalChunk, 1); 395 + if (!chunk) 396 + { 397 + g_slist_free (idList); 398 + return 1; 399 + } 400 + 401 + chunk->client = client; 402 + 403 + /* search list of applets for wnck-applet */ 404 + g_slist_foreach (idList, 405 + check_for_wnck_entry, 406 + (gpointer) chunk); 407 + 408 + if (chunk->numRowsArray == NULL) 409 + rows = 1; 410 + else 411 + rows = g_array_index (chunk->numRowsArray, gint, 0); 412 + 413 + /* clean up */ 414 + g_slist_free (idList); 415 + g_array_free (chunk->numRowsArray, TRUE); 416 + g_free (chunk); 417 + 418 + return rows; 419 +} 420 + 421 +/* sets the number of rows of the first pager-applet found */ 422 +void static 423 +set_pager_num_rows (GConfClient *client, 424 + gint rows) 425 +{ 426 + GSList *idList = NULL; 427 + TraversalChunk *chunk = NULL; 428 + 429 + /* get ids of all used applets */ 430 + idList = gconf_client_get_list (client, 431 + "/apps/panel/general/applet_id_list", 432 + GCONF_VALUE_STRING, 433 + NULL); 434 + 435 + /* if nothing is found at least return 1 to avoid a div. by 0 later */ 436 + if (!idList) 437 + return; 438 + 439 + /* create and initialize helper-structure */ 440 + chunk = g_new0 (TraversalChunk, 1); 441 + if (!chunk) 442 + { 443 + g_slist_free (idList); 444 + return; 445 + } 446 + 447 + chunk->client = client; 448 + chunk->rows = rows; 449 + 450 + /* search list of applets for wnck-applet */ 451 + g_slist_foreach (idList, 452 + set_wnck_entry, 453 + (gpointer) chunk); 454 + 455 + /* clean up */ 456 + g_slist_free (idList); 457 + g_array_free (chunk->numRowsArray, TRUE); 458 + g_free (chunk); 459 +} 460 + 461 +static void 462 +apply_settings (AppearanceData *app, 463 + gboolean effects_enabled) 464 +{ 465 + const char *str = effects_enabled? COMPIZ_BIN : METACITY_BIN; 466 + char *session_file; 467 + gint vsize; 468 + gint hsize; 469 + gint workspaces; 470 + gint rows; 471 + 472 + gconf_client_set_string (app->client, 473 + WINDOW_MANAGER_KEY, 474 + str, 475 + NULL); 476 + 477 + session_file = g_build_filename (g_get_home_dir (), 478 + ".gnome2", 479 + "session", 480 + NULL); 481 + 482 + g_unlink (session_file); 483 + g_free (session_file); 484 + 485 + /* here the whole logic for mapping any N:M workspace-layout from 486 + * metacity to compiz or vice versa is handled, currently only 487 + * implemented for one-screen setups */ 488 + if (effects_enabled) 489 + { 490 + workspaces = get_int_value (app->client, 491 + "/apps/metacity/general/num_workspaces"); 492 + rows = get_pager_num_rows (app->client); 493 + set_int_value (app->client, 494 + "/apps/compiz/general/screen0/options/vsize", 495 + rows); 496 + set_int_value (app->client, 497 + "/apps/compiz/general/screen0/options/hsize", 498 + (gint) ceilf ((gfloat) workspaces / (gfloat) rows)); 499 + set_pager_num_rows (app->client, 1); 500 + } 501 + else if (app->compiz_was_running) 502 + { 503 + vsize = get_int_value (app->client, 504 + "/apps/compiz/general/screen0/options/vsize"); 505 + hsize = get_int_value (app->client, 506 + "/apps/compiz/general/screen0/options/hsize"); 507 + set_int_value (app->client, 508 + "/apps/metacity/general/num_workspaces", 509 + vsize * hsize); 510 + set_pager_num_rows (app->client, vsize); 511 + } 512 +} 513 + 514 +static void 515 +set_busy (GtkWidget *widget, 516 + gboolean busy) 517 +{ 518 + GdkCursor *cursor; 519 + 520 + if (busy) 521 + cursor = gdk_cursor_new (GDK_WATCH); 522 + else 523 + cursor = NULL; 524 + 525 + gdk_window_set_cursor (widget->window, cursor); 526 + 527 + if (cursor) 528 + gdk_cursor_unref (cursor); 529 + 530 + gdk_flush (); 531 +} 532 + 533 +/* get_wm_window() and current_window_manager() are essentially cutted and 534 + * pasted from gnome-wm.c from gnome-control-center. */ 535 +static Window 536 +get_wm_window (void) 537 +{ 538 + Window *xwindow; 539 + Atom type; 540 + gint format; 541 + gulong nitems; 542 + gulong bytes_after; 543 + Window result; 544 + 545 + XGetWindowProperty (GDK_DISPLAY (), 546 + GDK_ROOT_WINDOW (), 547 + XInternAtom (GDK_DISPLAY (), 548 + "_NET_SUPPORTING_WM_CHECK", 549 + False), 550 + 0, 551 + G_MAXLONG, 552 + False, 553 + XA_WINDOW, 554 + &type, 555 + &format, 556 + &nitems, 557 + &bytes_after, 558 + (guchar **) &xwindow); 559 + 560 + if (type != XA_WINDOW) 561 + return None; 562 + 563 + gdk_error_trap_push (); 564 + XSelectInput (GDK_DISPLAY (), 565 + *xwindow, 566 + StructureNotifyMask | PropertyChangeMask); 567 + XSync (GDK_DISPLAY (), False); 568 + 569 + if (gdk_error_trap_pop ()) 570 + { 571 + XFree (xwindow); 572 + return None; 573 + } 574 + 575 + result = *xwindow; 576 + XFree (xwindow); 577 + 578 + return result; 579 +} 580 + 581 +static char* 582 +get_current_window_manager (void) 583 +{ 584 + Atom utf8_string; 585 + Atom atom; 586 + Atom type; 587 + int result; 588 + char *retval; 589 + int format; 590 + gulong nitems; 591 + gulong bytes_after; 592 + gchar *val; 593 + Window wm_window = get_wm_window (); 594 + 595 + utf8_string = XInternAtom (GDK_DISPLAY (), "UTF8_STRING", False); 596 + atom = XInternAtom (GDK_DISPLAY (), "_NET_WM_NAME", False); 597 + 598 + gdk_error_trap_push (); 599 + 600 + result = XGetWindowProperty (GDK_DISPLAY (), 601 + wm_window, 602 + atom, 603 + 0, 604 + G_MAXLONG, 605 + False, 606 + utf8_string, 607 + &type, 608 + &format, 609 + &nitems, 610 + &bytes_after, 611 + (guchar **)&val); 612 + 613 + if (gdk_error_trap_pop () || result != Success) 614 + return NULL; 615 + 616 + if (type != utf8_string || format != 8 || nitems == 0) 617 + { 618 + if (val) 619 + XFree (val); 620 + 621 + return NULL; 622 + } 623 + 624 + if (!g_utf8_validate (val, nitems, NULL)) 625 + { 626 + XFree (val); 627 + return NULL; 628 + } 629 + 630 + retval = g_strndup (val, nitems); 631 + 632 + XFree (val); 633 + 634 + return retval; 635 +} 636 + 637 +static gboolean 638 +compiz_started (void) 639 +{ 640 + gboolean result; 641 + char *wm = get_current_window_manager (); 642 + 643 + result = wm && strcmp (wm, "compiz") == 0; 644 + 645 + g_free (wm); 646 + 647 + return result; 648 +} 649 + 650 +typedef struct TimedDialogInfo { 651 + AppearanceData *app; 652 + GTimer *timer; 653 + GtkWidget *button; 654 +} TimedDialogInfo; 655 + 656 +static WindowManager 657 +current_configured_wm (AppearanceData *app, 658 + GError **err) 659 +{ 660 + GError *tmp = NULL; 661 + 662 + const char *str = gconf_client_get_string (app->client, 663 + WINDOW_MANAGER_KEY, 664 + &tmp); 665 + 666 + if (tmp) 667 + { 668 + g_propagate_error (err, tmp); 669 + return METACITY; 670 + } 671 + 672 + if (str && strcmp (str, "/usr/bin/compiz") == 0) 673 + return COMPIZ; 674 + else 675 + return METACITY; 676 +} 677 + 678 +static void 679 +show_error (const GError *err) 680 +{ 681 + GtkWidget *dialog; 682 + 683 + if (!err) 684 + return; 685 + 686 + dialog = gtk_message_dialog_new (NULL, 687 + GTK_DIALOG_DESTROY_WITH_PARENT, 688 + GTK_MESSAGE_WARNING, 689 + GTK_BUTTONS_OK, 690 + err->message); 691 + 692 + gtk_window_set_title (GTK_WINDOW (dialog), ""); 693 + 694 + gtk_dialog_run (GTK_DIALOG (dialog)); 695 + gtk_widget_destroy (dialog); 696 +} 697 + 698 +struct TimeoutData { 699 + int time; 700 + GtkLabel *label; 701 + GtkDialog *dialog; 702 + gboolean timed_out; 703 +}; 704 + 705 +static gboolean 706 +free_at_idle (gpointer data) 707 +{ 708 + g_free (data); 709 + return FALSE; 710 +} 711 + 712 +static char* 713 +idle_free (char *str) 714 +{ 715 + g_idle_add (free_at_idle, str); 716 + return str; 717 +} 718 + 719 +static char * 720 +timeout_string (int time) 721 +{ 722 + char *str = g_strdup_printf (ngettext ("Testing the new settings. If you don't respond in %d second the previous settings will be restored.", "Testing the new settings. If you don't respond in %d seconds the previous settings will be restored.", time), time); 723 + 724 + return idle_free (str); 725 +} 726 + 727 +static gboolean 728 +save_timeout_callback (gpointer data) 729 +{ 730 + struct TimeoutData *timeData = data; 731 + 732 + timeData->time--; 733 + 734 + if (timeData->time == 0) 735 + { 736 + gtk_dialog_response (timeData->dialog, GTK_RESPONSE_NO); 737 + timeData->timed_out = TRUE; 738 + return FALSE; 739 + } 740 + 741 + gtk_label_set_text (timeData->label, timeout_string (timeData->time)); 742 + 743 + return TRUE; 744 +} 745 + 746 +static gboolean 747 +run_timed_dialog (AppearanceData *app) 748 +{ 749 + GtkWidget *dialog; 750 + GtkWidget *hbox; 751 + GtkWidget *vbox; 752 + GtkWidget *label; 753 + GtkWidget *label_sec; 754 + GtkWidget *image; 755 + int res; 756 + struct TimeoutData timeout_data; 757 + guint timeout; 758 + 759 + dialog = gtk_dialog_new (); 760 + gtk_window_set_transient_for (GTK_WINDOW (dialog), 761 + GTK_WINDOW (app->dialog)); 762 + gtk_window_set_destroy_with_parent (GTK_WINDOW (dialog), TRUE); 763 + gtk_window_set_modal (GTK_WINDOW (dialog), TRUE); 764 + gtk_container_set_border_width (GTK_CONTAINER (dialog), 12); 765 + gtk_dialog_set_has_separator (GTK_DIALOG (dialog), FALSE); 766 + gtk_window_set_title (GTK_WINDOW (dialog), _("Keep Settings")); 767 + gtk_window_set_position (GTK_WINDOW(dialog), GTK_WIN_POS_CENTER_ALWAYS); 768 + 769 + label = gtk_label_new (NULL); 770 + gtk_label_set_markup (GTK_LABEL (label), 771 + idle_free (g_strdup_printf ("<b>%s</b>", 772 + _("Do you want to keep these settings?")))); 773 + image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_QUESTION, 774 + GTK_ICON_SIZE_DIALOG); 775 + gtk_misc_set_alignment (GTK_MISC (image), 0.5, 0.0); 776 + 777 + gtk_label_set_line_wrap (GTK_LABEL (label), TRUE); 778 + gtk_label_set_selectable (GTK_LABEL (label), TRUE); 779 + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); 780 + 781 + label_sec = gtk_label_new (timeout_string (REVERT_COUNT)); 782 + gtk_label_set_line_wrap (GTK_LABEL (label_sec), TRUE); 783 + gtk_label_set_selectable (GTK_LABEL (label_sec), TRUE); 784 + gtk_misc_set_alignment (GTK_MISC (label_sec), 0.0, 0.5); 785 + 786 + hbox = gtk_hbox_new (FALSE, 6); 787 + vbox = gtk_vbox_new (FALSE, 6); 788 + 789 + gtk_box_pack_start (GTK_BOX (vbox), label, TRUE, TRUE, 0); 790 + gtk_box_pack_start (GTK_BOX (vbox), label_sec, TRUE, TRUE, 0); 791 + gtk_box_pack_start (GTK_BOX (hbox), image, FALSE, FALSE, 0); 792 + gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0); 793 + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), 794 + hbox, 795 + FALSE, 796 + FALSE, 797 + 0); 798 + gtk_dialog_add_buttons (GTK_DIALOG (dialog), 799 + _("Use _previous settings"), 800 + GTK_RESPONSE_NO, 801 + _("_Keep settings"), 802 + GTK_RESPONSE_YES, 803 + NULL); 804 + 805 + gtk_widget_show_all (hbox); 806 + 807 + timeout_data.time = REVERT_COUNT; 808 + timeout_data.label = GTK_LABEL (label_sec); 809 + timeout_data.dialog = GTK_DIALOG (dialog); 810 + timeout_data.timed_out = FALSE; 811 + 812 + timeout = g_timeout_add (1000, save_timeout_callback, &timeout_data); 813 + res = gtk_dialog_run (GTK_DIALOG (dialog)); 814 + 815 + if (!timeout_data.timed_out) 816 + g_source_remove (timeout); 817 + 818 + gtk_widget_destroy (dialog); 819 + 820 + return (res == GTK_RESPONSE_YES); 821 +} 822 + 823 +static gboolean 824 +show_dialog_timeout (gpointer data) 825 +{ 826 + TimedDialogInfo *info = data; 827 + gboolean has_compiz; 828 + 829 + gtk_window_present (GTK_WINDOW (info->app->dialog)); 830 + 831 + has_compiz = compiz_started (); 832 + 833 + if (has_compiz || 834 + g_timer_elapsed (info->timer, 835 + NULL) > SECONDS_WE_WILL_WAIT_FOR_COMPIZ_TO_START) 836 + { 837 + if (has_compiz) 838 + { 839 + set_busy (info->app->dialog, FALSE); 840 + 841 + if (run_timed_dialog (info->app)) 842 + apply_settings (info->app, 843 + info->app->desktop_effects_level >= 1); 844 + else 845 + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->button), 846 + TRUE); 847 + } 848 + else 849 + { 850 + GtkWidget *dialog; 851 + 852 + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (info->button), 853 + TRUE); 854 + 855 + set_busy (info->app->dialog, FALSE); 856 + 857 + dialog = gtk_message_dialog_new ((GtkWindow*) info->app->dialog, 858 + GTK_DIALOG_DESTROY_WITH_PARENT, 859 + GTK_MESSAGE_WARNING, 860 + GTK_BUTTONS_OK, 861 + _("Desktop effects could not be enabled")); 862 + 863 + gtk_window_set_title (GTK_WINDOW (dialog), ""); 864 + gtk_dialog_run (GTK_DIALOG (dialog)); 865 + gtk_widget_destroy (dialog); 866 + } 867 + 868 + gtk_widget_set_sensitive (info->app->dialog, TRUE); 869 + 870 + g_timer_destroy (info->timer); 871 + g_free (info); 872 + 873 + return FALSE; 874 + } 875 + 876 + return TRUE; 877 +} 878 + 879 +static gboolean 880 +start_compiz (AppearanceData *app, 881 + GError **err) 882 +{ 883 + if (!g_spawn_command_line_async ("gtk-window-decorator --replace", err)) 884 + return FALSE; 885 + 886 + if (!g_spawn_command_line_async ("compiz --indirect-rendering --replace ccp", err)) 887 + return FALSE; 888 + 889 + app->compiz_running = TRUE; 890 + 891 + return TRUE; 892 +} 893 + 894 +static gboolean 895 +start_metacity (AppearanceData *app, GError **err) 896 +{ 897 + if (!g_spawn_command_line_async ("metacity --replace", err)) 898 + return FALSE; 899 + 900 + app->compiz_running = FALSE; 901 + 902 + return TRUE; 903 +} 904 + 905 +static gboolean 906 +has_texture_from_pixmap () 907 +{ 908 +#ifdef HAVE_GL && HAVE_GL_GLX_H 909 +#include <GL/gl.h> 910 +#include <GL/glx.h> 911 + const char *glxServerExtensions = glXQueryServerString (GDK_DISPLAY (), 0, GLX_EXTENSIONS); 912 + if (glxServerExtensions == NULL || !strstr (glxServerExtensions, "GLX_EXT_texture_from_pixmap")) 913 + return FALSE; 914 + return TRUE; 915 +#else 916 + return FALSE; 917 +#endif 918 +} 919 + 920 + 921 +static gboolean 922 +has_composite () 923 +{ 924 + int dummy1; 925 + int dummy2; 926 + 927 + if (XCompositeQueryExtension (GDK_DISPLAY (), &dummy1, &dummy2)) 928 + return TRUE; 929 + 930 + return FALSE; 931 +} 932 + 933 +static void 934 +show_alert (const char *text) 935 +{ 936 + GtkWidget *dialog; 937 + 938 + dialog = gtk_message_dialog_new (NULL, 939 + GTK_DIALOG_MODAL, 940 + GTK_MESSAGE_ERROR, 941 + GTK_BUTTONS_OK, 942 + text); 943 + 944 + gtk_dialog_run (GTK_DIALOG (dialog)); 945 +} 946 + 947 +static gboolean 948 +are_effects_enabled (AppearanceData* app, 949 + const gchar** effects_list) 950 +{ 951 + int i; 952 + gboolean res = TRUE; 953 + GError *tmp = NULL; 954 + GSList *plugins; 955 + 956 + plugins = get_plugins (app, &tmp); 957 + for (i = 0; effects_list[i] != NULL; i++) 958 + res &= contains_string (plugins, effects_list[i]); 959 + 960 + return res; 961 +} 962 + 963 +static gboolean 964 +reset_plugins (AppearanceData *app) 965 +{ 966 + GError *error = NULL; 967 + 968 + return gconf_client_unset (app->client, PLUGIN_LIST_KEY, &error); 969 +} 970 + 971 +static gboolean 972 +are_normal_effects_enabled (AppearanceData *app) 973 +{ 974 + gboolean res = TRUE; 975 + GError *err = NULL; 976 + GSList *plugins, *default_plugins; 977 + 978 + default_plugins = gconf_value_get_list ( gconf_client_get_default_from_schema (app->client, PLUGIN_LIST_KEY, &err)); 979 + 980 + err = NULL; 981 + plugins = get_plugins (app, &err); 982 + for(;default_plugins; default_plugins = g_slist_next(default_plugins)) 983 + res &= contains_string(plugins, gconf_value_get_string(default_plugins->data)); 984 + 985 + return res; 986 +} 987 + 988 +static gboolean 989 +are_extra_effects_enabled (AppearanceData *app) 990 +{ 991 + return (are_effects_enabled (app, extra_effects) && 992 + are_normal_effects_enabled (app)); 993 +} 994 + 995 +static gint 996 +get_effects_level (AppearanceData *data) 997 +{ 998 + if (data->compiz_running) 999 + { 1000 + if (are_extra_effects_enabled (data)) 1001 + return EXTRA_EFFECTS; 1002 + else if (are_normal_effects_enabled (data)) 1003 + return NORMAL_EFFECTS; 1004 + else 1005 + return CUSTOM_EFFECTS; 1006 + } 1007 + else 1008 + return NO_EFFECTS; 1009 +} 1010 + 1011 +static gboolean 1012 +enable_normal_effects (AppearanceData* app) 1013 +{ 1014 + return reset_plugins (app); 1015 +} 1016 + 1017 +static gboolean 1018 +enable_extra_effects (AppearanceData* app) 1019 +{ 1020 + GError *err = NULL; 1021 + GSList *plugins = NULL; 1022 + int i; 1023 + 1024 + reset_plugins (app); 1025 + 1026 + for (i = 0; extra_effects[i] != NULL; i++) 1027 + plugins = g_slist_append (plugins, 1028 + (gchar*) extra_effects[i]); 1029 + 1030 + err = NULL; 1031 + gconf_client_set_list (app->client, 1032 + PLUGIN_LIST_KEY, 1033 + GCONF_VALUE_STRING, 1034 + plugins, 1035 + &err); 1036 + 1037 + return TRUE; 1038 +} 1039 + 1040 +static void 1041 +on_effects_toggle (GtkWidget *widget, 1042 + gpointer user_data) 1043 +{ 1044 + AppearanceData *appdata = user_data; 1045 + GtkWidget *previously_selected_button; 1046 + static gint old_effects_level; 1047 + static gboolean do_init = TRUE; 1048 + gint i; 1049 + GError *err = NULL; 1050 + 1051 + if (do_init == TRUE) 1052 + { 1053 + old_effects_level = get_effects_level (appdata); 1054 + do_init = FALSE; 1055 + } 1056 + 1057 + if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) 1058 + return; 1059 + 1060 + previously_selected_button = glade_xml_get_widget (appdata->xml, 1061 + effect_choices [old_effects_level]); 1062 + 1063 + /* Look for the button which has been selected */ 1064 + for (i = 0; i < G_N_ELEMENTS (effect_choices); i++) 1065 + { 1066 + if (widget == glade_xml_get_widget(appdata->xml, 1067 + effect_choices [i])) 1068 + break; 1069 + } 1070 + 1071 + appdata->desktop_effects_level = i; 1072 + 1073 + if (appdata->desktop_effects_level >= 1) 1074 + { 1075 + if (!has_composite ()) 1076 + { 1077 + show_alert ("The Composite extension is not available"); 1078 + return; 1079 + } 1080 + 1081 + if (old_effects_level == 0) 1082 + start_compiz (appdata, &err); 1083 + 1084 + if (appdata->desktop_effects_level == NORMAL_EFFECTS) 1085 + enable_normal_effects (appdata); 1086 + 1087 + if (appdata->desktop_effects_level == EXTRA_EFFECTS) 1088 + enable_extra_effects (appdata); 1089 + } 1090 + else 1091 + { 1092 + apply_settings (appdata, FALSE); 1093 + start_metacity (appdata, &err); 1094 + } 1095 + 1096 + if (err) 1097 + { 1098 + show_error (err); 1099 + 1100 + g_signal_handlers_block_by_func (widget, 1101 + (gpointer)on_effects_toggle, 1102 + appdata); 1103 + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (glade_xml_get_widget (appdata->xml, 1104 + effect_choices [old_effects_level])), 1105 + TRUE); 1106 + g_signal_handlers_unblock_by_func (widget, 1107 + (gpointer)on_effects_toggle, 1108 + appdata); 1109 + } 1110 + else 1111 + { 1112 + if (appdata->desktop_effects_level >= 1 && 1113 + old_effects_level == 0) 1114 + { 1115 + TimedDialogInfo *info = g_new0 (TimedDialogInfo, 1); 1116 + 1117 + info->app = appdata; 1118 + info->button = previously_selected_button; 1119 + info->timer = g_timer_new (); 1120 + 1121 + set_busy (info->app->dialog, TRUE); 1122 + gtk_widget_set_sensitive (appdata->dialog, FALSE); 1123 + 1124 + g_timeout_add (250, show_dialog_timeout, info); 1125 + } 1126 + } 1127 + 1128 + old_effects_level = i; 1129 +} 1130 + 1131 +void 1132 +effects_init (AppearanceData *data) 1133 +{ 1134 + GError *error = NULL; 1135 + GtkWidget *level_effects_button = NULL; 1136 + GtkWidget *hbox_custom_effects = NULL; 1137 + WindowManager wm = METACITY; 1138 + gint i; 1139 + const char *str = get_current_window_manager (); 1140 + if (str && strcmp (str, "compiz") == 0) 1141 + wm = COMPIZ; 1142 + 1143 + data->compiz_running = (wm == COMPIZ); 1144 + data->compiz_was_running = (wm == COMPIZ); 1145 + data->dialog = glade_xml_get_widget (data->xml, "appearance_window"); 1146 + 1147 + data->desktop_effects_level = get_effects_level (data); 1148 + 1149 + if (!has_composite () || !has_texture_from_pixmap () || !check_compiz ()) 1150 + { 1151 + GtkWidget *vbox = glade_xml_get_widget (data->xml, "effects_vbox"); 1152 + GList *children = gtk_container_get_children (GTK_CONTAINER (vbox)); 1153 + GtkWidget *label = gtk_label_new (NULL); 1154 + GtkWidget *hbox = gtk_hbox_new (FALSE, 0); 1155 + GtkWidget *image = gtk_image_new_from_stock (GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); 1156 + GString *message = g_string_new ("<b>Visual effects cannot be enabled</b>\n\nDetails :\n"); 1157 + 1158 + gtk_container_add (GTK_CONTAINER (vbox), hbox); 1159 + gtk_container_add (GTK_CONTAINER (hbox), image); 1160 + 1161 + while (children) 1162 + { 1163 + GtkWidget *child = (GtkWidget*) children->data; 1164 + gtk_container_remove (GTK_CONTAINER (vbox), child); 1165 + children = children->next; 1166 + } 1167 + if (!has_composite ()) 1168 + g_string_append (message, "\nComposite extension is not enabled"); 1169 + 1170 + if (!has_texture_from_pixmap ()) 1171 + { 1172 + #ifndef HAVE_GL && HAVE_GL_GLX_H 1173 + g_string_append (message, "\nThis application was compiled without the OpenGL extension"); 1174 + #else 1175 + g_string_append (message, "\nThe OpenGL extension TextureFromPixmap is not enabled"); 1176 + #endif 1177 + } 1178 + 1179 + if (!check_compiz ()) 1180 + g_string_append (message, "\nCompiz is not installed on the system"); 1181 + 1182 + 1183 + gtk_label_set_markup (GTK_LABEL (label), message->str); 1184 + gtk_container_add (GTK_CONTAINER (hbox), label); 1185 + gtk_widget_show (label); 1186 + g_string_free (message, TRUE); 1187 + if (check_compiz_configure () && check_compiz ()) 1188 + { 1189 + GtkWidget* button = gtk_button_new_with_label ("Check if visual effects can be enabled"); 1190 + GtkWidget* align = gtk_alignment_new (0.5, 0.5, 0, 0); 1191 + g_signal_connect (button, 1192 + "clicked", 1193 + G_CALLBACK (run_compiz_configure), 1194 + NULL); 1195 + 1196 + gtk_container_add (GTK_CONTAINER (align), button); 1197 + gtk_container_add (GTK_CONTAINER (vbox), align); 1198 + gtk_box_set_child_packing (GTK_BOX (vbox), 1199 + button, 1200 + FALSE, 1201 + FALSE, 1202 + 0, 1203 + GTK_PACK_END); 1204 + gtk_widget_show (button); 1205 + } 1206 + return; 1207 + } 1208 + 1209 + 1210 + for (i = 0; i < G_N_ELEMENTS (effect_choices); i++) 1211 + { 1212 + level_effects_button = glade_xml_get_widget (data->xml, 1213 + effect_choices[i]); 1214 + if (i == data->desktop_effects_level) 1215 + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (level_effects_button), 1216 + TRUE); 1217 + 1218 + g_signal_connect (level_effects_button, 1219 + "toggled", 1220 + G_CALLBACK (on_effects_toggle), 1221 + data); 1222 + } 1223 + 1224 + hbox_custom_effects = glade_xml_get_widget (data->xml, 1225 + "hbox_custom_effects"); 1226 + if (check_ccsm ()) 1227 + { 1228 + GtkWidget *button = NULL; 1229 + 1230 + gtk_widget_show (hbox_custom_effects); 1231 + button = glade_xml_get_widget (data->xml, 1232 + "custom_effects_edit_button"); 1233 + g_signal_connect (button, 1234 + "clicked", 1235 + G_CALLBACK (run_ccsm), 1236 + NULL); 1237 + } 1238 + else 1239 + gtk_widget_hide (hbox_custom_effects); 1240 +} 1241 + 1242 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/appearance-effects.h gnome-control-center-2.23.4/capplets/appearance/appearance-effects.h 1243 --- ../gnome-control-center-2.23.4/capplets/appearance/appearance-effects.h 1970-01-01 01:00:00.000000000 +0100 1244 +++ gnome-control-center-2.23.4/capplets/appearance/appearance-effects.h 2008-07-02 14:32:20.886813771 +0200 1245 @@ -0,0 +1,21 @@ 1246 +/* 1247 + * Copyright (C) 2007 Canonical 1248 + * Written by Michael Vogt <mvo (a] ubuntu.com> 1249 + * All Rights Reserved 1250 + * 1251 + * This program is free software; you can redistribute it and/or modify 1252 + * it under the terms of the GNU General Public License as published by 1253 + * the Free Software Foundation; either version 2 of the License, or 1254 + * (at your option) any later version. 1255 + * 1256 + * This program is distributed in the hope that it will be useful, 1257 + * but WITHOUT ANY WARRANTY; without even the implied warranty of 1258 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1259 + * GNU General Public License for more details. 1260 + * 1261 + * You should have received a copy of the GNU General Public License along 1262 + * with this program; if not, write to the Free Software Foundation, Inc., 1263 + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 1264 + */ 1265 + 1266 +void effects_init (AppearanceData *data); 1267 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/appearance-main.c gnome-control-center-2.23.4/capplets/appearance/appearance-main.c 1268 --- ../gnome-control-center-2.23.4/capplets/appearance/appearance-main.c 2008-07-02 14:32:05.977307029 +0200 1269 +++ gnome-control-center-2.23.4/capplets/appearance/appearance-main.c 2008-07-02 14:32:20.887323017 +0200 1270 @@ -153,6 +153,7 @@ main (int argc, char **argv) 1271 g_strfreev (wallpaper_files); 1272 font_init (data); 1273 ui_init (data); 1274 + effects_init (data); 1275 1276 /* prepare the main window */ 1277 w = glade_xml_get_widget (data->xml, "appearance_window"); 1278 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/appearance.h gnome-control-center-2.23.4/capplets/appearance/appearance.h 1279 --- ../gnome-control-center-2.23.4/capplets/appearance/appearance.h 2008-07-02 14:32:05.981962978 +0200 1280 +++ gnome-control-center-2.23.4/capplets/appearance/appearance.h 2008-07-02 14:32:20.887769430 +0200 1281 @@ -71,6 +71,12 @@ typedef struct { 1282 gchar *revert_windowtitle_font; 1283 gchar *revert_monospace_font; 1284 1285 + /* effects */ 1286 + gboolean compiz_running; 1287 + gboolean compiz_was_running; 1288 + gint desktop_effects_level; 1289 + GtkWidget *dialog; 1290 + 1291 /* style */ 1292 GdkPixbuf *gtk_theme_icon; 1293 GdkPixbuf *window_theme_icon; 1294 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/data/Makefile.am gnome-control-center-2.23.4/capplets/appearance/data/Makefile.am 1295 --- ../gnome-control-center-2.23.4/capplets/appearance/data/Makefile.am 2008-07-02 14:32:05.981515026 +0200 1296 +++ gnome-control-center-2.23.4/capplets/appearance/data/Makefile.am 2008-07-02 14:32:20.888085484 +0200 1297 @@ -15,7 +15,11 @@ dist_pixmap_DATA = \ 1298 mouse-cursor-normal.png \ 1299 mouse-cursor-normal-large.png \ 1300 mouse-cursor-white.png \ 1301 - mouse-cursor-white-large.png 1302 + mouse-cursor-white-large.png \ 1303 + visual-effects_custom.svg \ 1304 + visual-effects_extra.svg \ 1305 + visual-effects_none.svg \ 1306 + visual-effects_normal.svg 1307 1308 cursorfontdir = $(datadir)/gnome/cursor-fonts 1309 dist_cursorfont_DATA = \ 1310 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/capplets/appearance/data/appearance.glade gnome-control-center-2.23.4/capplets/appearance/data/appearance.glade 1311 --- ../gnome-control-center-2.23.4/capplets/appearance/data/appearance.glade 2008-07-02 14:32:05.981182318 +0200 1312 +++ gnome-control-center-2.23.4/capplets/appearance/data/appearance.glade 2008-07-02 14:32:20.890782787 +0200 1313 @@ -1825,6 +1825,281 @@ Text only</property> 1314 <property name="tab_fill">False</property> 1315 </packing> 1316 </child> 1317 + <child> 1318 + <widget class="GtkVBox" id="effects_vbox"> 1319 + <property name="visible">True</property> 1320 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1321 + <property name="border_width">6</property> 1322 + <property name="spacing">18</property> 1323 + <property name="homogeneous">True</property> 1324 + <child> 1325 + <widget class="GtkRadioButton" id="no_effects_button"> 1326 + <property name="visible">True</property> 1327 + <property name="can_focus">True</property> 1328 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1329 + <property name="response_id">0</property> 1330 + <property name="active">True</property> 1331 + <property name="draw_indicator">True</property> 1332 + <accelerator key="n" modifiers="" signal="activate"/> 1333 + <child> 1334 + <widget class="GtkHBox" id="hbox_no_effects"> 1335 + <property name="visible">True</property> 1336 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1337 + <child> 1338 + <widget class="GtkImage" id="image_no_effects"> 1339 + <property name="visible">True</property> 1340 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1341 + <property name="xpad">6</property> 1342 + <property name="pixbuf">/usr/share/gnome-control-center/pixmaps/visual-effects_none.svg</property> 1343 + <property name="icon_size">6</property> 1344 + </widget> 1345 + </child> 1346 + <child> 1347 + <widget class="GtkLabel" id="label_desc_no_effects"> 1348 + <property name="visible">True</property> 1349 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1350 + <property name="xpad">6</property> 1351 + <property name="label" translatable="yes"><b>_None:</b> Provides a simple desktop environment without any effects.</property> 1352 + <property name="use_markup">True</property> 1353 + <property name="use_underline">True</property> 1354 + <property name="wrap">True</property> 1355 + </widget> 1356 + <packing> 1357 + <property name="position">1</property> 1358 + </packing> 1359 + </child> 1360 + </widget> 1361 + </child> 1362 + </widget> 1363 + <packing> 1364 + <property name="expand">False</property> 1365 + <property name="fill">False</property> 1366 + <property name="padding">6</property> 1367 + </packing> 1368 + </child> 1369 + <child> 1370 + <widget class="GtkRadioButton" id="normal_effects_button"> 1371 + <property name="visible">True</property> 1372 + <property name="can_focus">True</property> 1373 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1374 + <property name="response_id">0</property> 1375 + <property name="active">True</property> 1376 + <property name="draw_indicator">True</property> 1377 + <property name="group">no_effects_button</property> 1378 + <accelerator key="o" modifiers="" signal="activate"/> 1379 + <child> 1380 + <widget class="GtkHBox" id="hbox_normal_effects"> 1381 + <property name="visible">True</property> 1382 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1383 + <child> 1384 + <widget class="GtkImage" id="image_normal_effects"> 1385 + <property name="visible">True</property> 1386 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1387 + <property name="xpad">6</property> 1388 + <property name="pixbuf">/usr/share/gnome-control-center/pixmaps/visual-effects_normal.svg</property> 1389 + <property name="icon_size">6</property> 1390 + </widget> 1391 + </child> 1392 + <child> 1393 + <widget class="GtkLabel" id="label_desc_normal_effects"> 1394 + <property name="visible">True</property> 1395 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1396 + <property name="xpad">6</property> 1397 + <property name="label" translatable="yes"><b>N_ormal:</b> Provides improved usability and good balance between attractiveness and moderate performance-requirements.</property> 1398 + <property name="use_markup">True</property> 1399 + <property name="use_underline">True</property> 1400 + <property name="wrap">True</property> 1401 + </widget> 1402 + <packing> 1403 + <property name="position">1</property> 1404 + </packing> 1405 + </child> 1406 + </widget> 1407 + </child> 1408 + </widget> 1409 + <packing> 1410 + <property name="expand">False</property> 1411 + <property name="fill">False</property> 1412 + <property name="padding">6</property> 1413 + <property name="position">1</property> 1414 + </packing> 1415 + </child> 1416 + <child> 1417 + <widget class="GtkRadioButton" id="extra_effects_button"> 1418 + <property name="visible">True</property> 1419 + <property name="can_focus">True</property> 1420 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1421 + <property name="response_id">0</property> 1422 + <property name="active">True</property> 1423 + <property name="draw_indicator">True</property> 1424 + <property name="group">no_effects_button</property> 1425 + <accelerator key="x" modifiers="" signal="activate"/> 1426 + <child> 1427 + <widget class="GtkHBox" id="hbox_extra_effects"> 1428 + <property name="visible">True</property> 1429 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1430 + <child> 1431 + <widget class="GtkImage" id="image_extra_effects"> 1432 + <property name="visible">True</property> 1433 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1434 + <property name="xpad">6</property> 1435 + <property name="pixbuf">/usr/share/gnome-control-center/pixmaps/visual-effects_extra.svg</property> 1436 + <property name="icon_size">6</property> 1437 + </widget> 1438 + </child> 1439 + <child> 1440 + <widget class="GtkLabel" id="label_desc_extra_effects"> 1441 + <property name="visible">True</property> 1442 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1443 + <property name="xpad">6</property> 1444 + <property name="label" translatable="yes"><b>E_xtra:</b> Provides more aesthetically pleasing set of effects. Requires faster graphics-card.</property> 1445 + <property name="use_markup">True</property> 1446 + <property name="use_underline">True</property> 1447 + <property name="wrap">True</property> 1448 + </widget> 1449 + <packing> 1450 + <property name="position">1</property> 1451 + </packing> 1452 + </child> 1453 + </widget> 1454 + </child> 1455 + </widget> 1456 + <packing> 1457 + <property name="expand">False</property> 1458 + <property name="fill">False</property> 1459 + <property name="padding">6</property> 1460 + <property name="position">2</property> 1461 + </packing> 1462 + </child> 1463 + <child> 1464 + <widget class="GtkHBox" id="hbox_custom_effects"> 1465 + <property name="visible">True</property> 1466 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1467 + <property name="no_show_all">True</property> 1468 + <child> 1469 + <widget class="GtkRadioButton" id="custom_effects_button"> 1470 + <property name="visible">True</property> 1471 + <property name="can_focus">True</property> 1472 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1473 + <property name="response_id">0</property> 1474 + <property name="active">True</property> 1475 + <property name="draw_indicator">True</property> 1476 + <property name="group">no_effects_button</property> 1477 + <accelerator key="u" modifiers="" signal="activate"/> 1478 + <child> 1479 + <widget class="GtkHBox" id="hbox_custom_effects_2"> 1480 + <property name="visible">True</property> 1481 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1482 + <property name="spacing">6</property> 1483 + <child> 1484 + <widget class="GtkImage" id="image_custom_effects"> 1485 + <property name="visible">True</property> 1486 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1487 + <property name="xpad">6</property> 1488 + <property name="pixbuf">/usr/share/gnome-control-center/pixmaps/visual-effects_custom.svg</property> 1489 + <property name="icon_size">6</property> 1490 + </widget> 1491 + <packing> 1492 + <property name="expand">False</property> 1493 + <property name="fill">False</property> 1494 + </packing> 1495 + </child> 1496 + <child> 1497 + <widget class="GtkLabel" id="label_desc_custom_effects"> 1498 + <property name="visible">True</property> 1499 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1500 + <property name="label" translatable="yes"><b>C_ustom:</b> Uses custom set of effects.</property> 1501 + <property name="use_markup">True</property> 1502 + <property name="use_underline">True</property> 1503 + <property name="wrap">True</property> 1504 + </widget> 1505 + <packing> 1506 + <property name="expand">False</property> 1507 + <property name="fill">False</property> 1508 + <property name="position">1</property> 1509 + </packing> 1510 + </child> 1511 + </widget> 1512 + </child> 1513 + </widget> 1514 + <packing> 1515 + <property name="expand">False</property> 1516 + <property name="fill">False</property> 1517 + </packing> 1518 + </child> 1519 + <child> 1520 + <widget class="GtkVBox" id="vbox_custom_effects"> 1521 + <property name="visible">True</property> 1522 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1523 + <child> 1524 + <widget class="GtkLabel" id="label_dummy_1"> 1525 + <property name="visible">True</property> 1526 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1527 + </widget> 1528 + <packing> 1529 + <property name="expand">False</property> 1530 + <property name="fill">False</property> 1531 + </packing> 1532 + </child> 1533 + <child> 1534 + <widget class="GtkButton" id="custom_effects_edit_button"> 1535 + <property name="visible">True</property> 1536 + <property name="can_focus">True</property> 1537 + <property name="receives_default">True</property> 1538 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1539 + <property name="label" translatable="yes">gtk-preferences</property> 1540 + <property name="use_stock">True</property> 1541 + <property name="response_id">0</property> 1542 + </widget> 1543 + <packing> 1544 + <property name="expand">False</property> 1545 + <property name="fill">False</property> 1546 + <property name="position">1</property> 1547 + </packing> 1548 + </child> 1549 + <child> 1550 + <widget class="GtkLabel" id="label_dummy_2"> 1551 + <property name="visible">True</property> 1552 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1553 + </widget> 1554 + <packing> 1555 + <property name="expand">False</property> 1556 + <property name="fill">False</property> 1557 + <property name="position">2</property> 1558 + </packing> 1559 + </child> 1560 + </widget> 1561 + <packing> 1562 + <property name="expand">False</property> 1563 + <property name="fill">False</property> 1564 + <property name="padding">6</property> 1565 + <property name="position">1</property> 1566 + </packing> 1567 + </child> 1568 + </widget> 1569 + <packing> 1570 + <property name="expand">False</property> 1571 + <property name="fill">False</property> 1572 + <property name="position">3</property> 1573 + </packing> 1574 + </child> 1575 + </widget> 1576 + <packing> 1577 + <property name="position">4</property> 1578 + </packing> 1579 + </child> 1580 + <child> 1581 + <widget class="GtkLabel" id="label5"> 1582 + <property name="visible">True</property> 1583 + <property name="events">GDK_POINTER_MOTION_MASK | GDK_POINTER_MOTION_HINT_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK</property> 1584 + <property name="label" translatable="yes">Visual Effects</property> 1585 + </widget> 1586 + <packing> 1587 + <property name="type">tab</property> 1588 + <property name="position">4</property> 1589 + <property name="tab_fill">False</property> 1590 + </packing> 1591 + </child> 1592 </widget> 1593 <packing> 1594 <property name="position">1</property> 1595 diff -x '*.orig' -Nrup ../gnome-control-center-2.23.4/configure.in gnome-control-center-2.23.4/configure.in 1596 --- ../gnome-control-center-2.23.4/configure.in 2008-07-02 14:32:05.984484037 +0200 1597 +++ gnome-control-center-2.23.4/configure.in 2008-07-02 14:32:20.891481279 +0200 1598 @@ -148,6 +148,22 @@ DISPLAY_CAPPLET_LIBS="$DISPLAY_CAPPLET_L 1599 CAPPLET_LIBS="$CAPPLET_LIBS $x_libs" 1600 GNOMECC_LIBS="$GNOMECC_LIBS $x_libs" 1601 1602 +dnl 1603 +dnl Check for OpenGL support 1604 +dnl 1605 +have_gl=0 1606 +have_libgl=0 1607 +AC_CHECK_HEADERS(GL/glx.h) 1608 +if test $ac_cv_header_GL_glx_h = yes ; then 1609 + AC_CHECK_FUNC(glXQueryExtension,[have_gl=1],AC_CHECK_LIB(GL,glXQueryExtension,[have_gl=1;have_libgl=1])) 1610 +fi 1611 +if test $have_gl = 1 ; then 1612 + AC_DEFINE(HAVE_GL,1,[Whether we have GL and glX.]) 1613 +fi 1614 +if test $have_libgl = 1 ; then 1615 + LIBS="-lGL $LIBS" 1616 +fi 1617 + 1618 dnl 1619 dnl Check for XCursor support. If it exists, then we compile the 1620 dnl mouse capplet with support for it turned on 1621