From a87157176ca6e01c8c4047999ee584f00b63c11e Mon Sep 17 00:00:00 2001 From: Stefano Karapetsas Date: Fri, 31 May 2013 16:22:39 +0200 Subject: Implement side-by-side tiling MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch by Florian Müllner for Metacity https://bugzilla.gnome.org/show_bug.cgi?id=607694 When dragging a window over a screen edge and dropping it there, maximize it vertically and scale it horizontally to cover the corresponding half of the current monitor. Whenever a "hot area" which triggers this behavior is entered, an indication of window's target size is displayed after a short delay to avoid distraction when moving a window between monitors. --- src/include/core.h | 4 ++++ src/include/prefs.h | 2 ++ src/include/tile-preview.h | 37 +++++++++++++++++++++++++++++++++++++ src/include/ui.h | 1 + 4 files changed, 44 insertions(+) create mode 100644 src/include/tile-preview.h (limited to 'src/include') diff --git a/src/include/core.h b/src/include/core.h index 66db2f81..14c1c151 100644 --- a/src/include/core.h +++ b/src/include/core.h @@ -116,6 +116,10 @@ void meta_core_user_focus (Display *xdisplay, Window frame_xwindow, guint32 timestamp); +void meta_core_lower_beneath_focus_window (Display *xdisplay, + Window xwindow, + guint32 timestamp); + void meta_core_minimize (Display *xdisplay, Window frame_xwindow); void meta_core_toggle_maximize (Display *xdisplay, diff --git a/src/include/prefs.h b/src/include/prefs.h index 2b7cfe41..4856d580 100644 --- a/src/include/prefs.h +++ b/src/include/prefs.h @@ -63,6 +63,7 @@ typedef enum META_PREF_COMPOSITING_FAST_ALT_TAB, META_PREF_RESIZE_WITH_RIGHT_BUTTON, META_PREF_CENTER_NEW_WINDOWS, + META_PREF_SIDE_BY_SIDE_TILING, META_PREF_FORCE_FULLSCREEN } MetaPreference; @@ -95,6 +96,7 @@ MetaWrapStyle meta_prefs_get_wrap_style (void); gboolean meta_prefs_get_reduced_resources (void); gboolean meta_prefs_get_mate_accessibility (void); gboolean meta_prefs_get_mate_animations (void); +gboolean meta_prefs_get_side_by_side_tiling (void); const char* meta_prefs_get_command (int i); diff --git a/src/include/tile-preview.h b/src/include/tile-preview.h new file mode 100644 index 00000000..b0ca3b01 --- /dev/null +++ b/src/include/tile-preview.h @@ -0,0 +1,37 @@ +/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ + +/* Meta tile preview */ + +/* + * Copyright (C) 2010 Florian Müllner + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + * 02111-1307, USA. + */ +#ifndef META_TILE_PREVIEW_H +#define META_TILE_PREVIEW_H + +#include "boxes.h" + +typedef struct _MetaTilePreview MetaTilePreview; + +MetaTilePreview *meta_tile_preview_new (int screen_number, + gboolean composited); +void meta_tile_preview_free (MetaTilePreview *preview); +void meta_tile_preview_show (MetaTilePreview *preview, + MetaRectangle *rect); +void meta_tile_preview_hide (MetaTilePreview *preview); + +#endif /* META_TILE_PREVIEW_H */ \ No newline at end of file diff --git a/src/include/ui.h b/src/include/ui.h index a8866498..23525193 100644 --- a/src/include/ui.h +++ b/src/include/ui.h @@ -205,5 +205,6 @@ MetaUIDirection meta_ui_get_direction (void); GdkPixbuf *meta_ui_get_pixbuf_from_pixmap (Pixmap pmap); #include "tabpopup.h" +#include "tile-preview.h" #endif -- cgit v1.2.1