Ticket #602: 0001-Add-a-switch-to-disable-autofullscreen-ing-maximized.patch

File 0001-Add-a-switch-to-disable-autofullscreen-ing-maximized.patch, 4.5 KB (added by tomeu, 15 years ago)
  • src/core/constraints.c

    From 118c8dc33376ba80dc7652392e5b30da9c102d77 Mon Sep 17 00:00:00 2001
    From: Tomeu Vizoso <tomeu@sugarlabs.org>
    Date: Fri, 19 Jun 2009 17:30:37 +0200
    Subject: [PATCH] Add a switch to disable autofullscreen'ing maximized windows without decorations
    
    ---
     src/core/constraints.c |    4 +++-
     src/core/main.c        |   10 ++++++++++
     src/core/prefs.c       |   17 +++++++++++++++++
     src/include/prefs.h    |    6 +++++-
     4 files changed, 35 insertions(+), 2 deletions(-)
    
    diff --git a/src/core/constraints.c b/src/core/constraints.c
    index 800b293..a060d20 100644
    a b  
    2727#include "constraints.h"
    2828#include "workspace.h"
    2929#include "place.h"
     30#include "prefs.h"
    3031
    3132#include <stdlib.h>
    3233#include <math.h>
    setup_constraint_info (ConstraintInfo *info, 
    424425  /* Workaround braindead legacy apps that don't know how to
    425426   * fullscreen themselves properly.
    426427   */
    427   if (meta_rectangle_equal (new, &xinerama_info->rect) &&
     428  if (meta_prefs_get_force_fullscreen() &&
     429      meta_rectangle_equal (new, &xinerama_info->rect) &&
    428430      window->has_fullscreen_func &&
    429431      !window->fullscreen)
    430432    {
  • src/core/main.c

    diff --git a/src/core/main.c b/src/core/main.c
    index 6c36f10..a36a396 100644
    a b typedef struct 
    233233  gboolean sync;
    234234  gboolean composite;
    235235  gboolean no_composite;
     236  gboolean no_force_fullscreen;
    236237} MetaArguments;
    237238
    238239#ifdef HAVE_COMPOSITE_EXTENSIONS
    meta_parse_options (int *argc, char ***argv, 
    314315      N_("Turn compositing off"),
    315316      NULL
    316317    },
     318    {
     319      "no-force-fullscreen", 0, COMPOSITE_OPTS_FLAGS, G_OPTION_ARG_NONE,
     320      &my_args.no_force_fullscreen,
     321      N_("Don't make fullscreen windows that are maximized and have no decorations"),
     322      NULL
     323    },
    317324    {NULL}
    318325  };
    319326  GOptionContext *ctx;
    main (int argc, char **argv) 
    584591  if (meta_args.composite || meta_args.no_composite)
    585592    meta_prefs_set_compositing_manager (meta_args.composite);
    586593
     594  if (meta_args.no_force_fullscreen)
     595    meta_prefs_set_force_fullscreen (FALSE);
     596
    587597  if (!meta_display_open ())
    588598    meta_exit (META_EXIT_ERROR);
    589599 
  • src/core/prefs.c

    diff --git a/src/core/prefs.c b/src/core/prefs.c
    index 1f4fe41..6e41b3c 100644
    a b static char *cursor_theme = NULL; 
    9595static int   cursor_size = 24;
    9696static gboolean compositing_manager = FALSE;
    9797static gboolean resize_with_right_button = FALSE;
     98static gboolean force_fullscreen = TRUE;
    9899
    99100static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
    100101static MetaButtonLayout button_layout;
    meta_preference_to_string (MetaPreference pref) 
    17511752
    17521753    case META_PREF_RESIZE_WITH_RIGHT_BUTTON:
    17531754      return "RESIZE_WITH_RIGHT_BUTTON";
     1755
     1756    case META_PREF_FORCE_FULLSCREEN:
     1757      return "FORCE_FULLSCREEN";
    17541758    }
    17551759
    17561760  return "(unknown)";
    meta_prefs_get_mouse_button_menu (void) 
    27372741  return resize_with_right_button ? 2: 3;
    27382742}
    27392743
     2744gboolean
     2745meta_prefs_get_force_fullscreen (void)
     2746{
     2747  return force_fullscreen;
     2748}
     2749
    27402750void
    27412751meta_prefs_set_compositing_manager (gboolean whether)
    27422752{
    init_button_layout(void) 
    27972807};
    27982808
    27992809#endif
     2810
     2811void
     2812meta_prefs_set_force_fullscreen (gboolean whether)
     2813{
     2814  force_fullscreen = whether;
     2815}
     2816
  • src/include/prefs.h

    diff --git a/src/include/prefs.h b/src/include/prefs.h
    index 2f1ce8e..a4193ff 100644
    a b typedef enum 
    5959  META_PREF_CURSOR_THEME,
    6060  META_PREF_CURSOR_SIZE,
    6161  META_PREF_COMPOSITING_MANAGER,
    62   META_PREF_RESIZE_WITH_RIGHT_BUTTON
     62  META_PREF_RESIZE_WITH_RIGHT_BUTTON,
     63  META_PREF_FORCE_FULLSCREEN
    6364} MetaPreference;
    6465
    6566typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
    void meta_prefs_change_workspace_name (int i, 
    114115const char* meta_prefs_get_cursor_theme      (void);
    115116int         meta_prefs_get_cursor_size       (void);
    116117gboolean    meta_prefs_get_compositing_manager (void);
     118gboolean    meta_prefs_get_force_fullscreen  (void);
    117119
    118120/**
    119121 * Sets whether the compositor is turned on.
    gboolean meta_prefs_get_compositing_manager (void); 
    122124 */
    123125void meta_prefs_set_compositing_manager (gboolean whether);
    124126
     127void meta_prefs_set_force_fullscreen (gboolean whether);
     128
    125129/* XXX FIXME This should be x-macroed, but isn't yet because it would be
    126130 * difficult (or perhaps impossible) to add the suffixes using the current
    127131 * system.  It needs some more thought, perhaps after the current system