marco 1.29.1
Window manager
Loading...
Searching...
No Matches
place.c File Reference
View source
#include <config.h>
#include "place.h"
#include "workspace.h"
#include "prefs.h"
#include <gdk/gdk.h>
#include <math.h>
#include <stdlib.h>
Include dependency graph for place.c:

Macros

#define CASCADE_FUZZ   15
 
#define CASCADE_INTERVAL   50 /* space between top-left corners of cascades */
 

Enumerations

enum  MetaWindowDirection { META_LEFT , META_RIGHT , META_TOP , META_BOTTOM }
 

Functions

static gint northwestcmp (gconstpointer a, gconstpointer b)
 
static gboolean place_by_pointer (MetaWindow *window, MetaFrameBorders *borders, MetaPlacementMode placement_mode, int *new_x, int *new_y)
 
static void find_next_cascade (MetaWindow *window, MetaFrameBorders *borders, GList *windows, int x, int y, int *new_x, int *new_y)
 
static void find_most_freespace (MetaWindow *window, MetaFrameBorders *borders, MetaWindow *focus_window, int x, int y, int *new_x, int *new_y)
 
static void avoid_being_obscured_as_second_modal_dialog (MetaWindow *window, MetaFrameBorders *borders, int *x, int *y)
 
static gboolean rectangle_overlaps_some_window (MetaRectangle *rect, GList *windows)
 
static gint leftmost_cmp (gconstpointer a, gconstpointer b)
 
static gint topmost_cmp (gconstpointer a, gconstpointer b)
 
static void center_tile_rect_in_area (MetaRectangle *rect, MetaRectangle *work_area)
 
void center_rect_in_area (MetaRectangle *rect, MetaRectangle *work_area)
 
static gboolean find_first_fit (MetaWindow *window, MetaFrameBorders *borders, GList *windows, int xinerama, int x, int y, int *new_x, int *new_y)
 
void meta_window_place (MetaWindow *window, MetaFrameBorders *borders, int x, int y, int *new_x, int *new_y)
 

Macro Definition Documentation

◆ CASCADE_FUZZ

#define CASCADE_FUZZ   15

◆ CASCADE_INTERVAL

#define CASCADE_INTERVAL   50 /* space between top-left corners of cascades */

Enumeration Type Documentation

◆ MetaWindowDirection

Enumerator
META_LEFT 
META_RIGHT 
META_TOP 
META_BOTTOM 

Function Documentation

◆ avoid_being_obscured_as_second_modal_dialog()

static void avoid_being_obscured_as_second_modal_dialog ( MetaWindow *  window,
MetaFrameBorders *  borders,
int *  x,
int *  y 
)
static

References _MetaWindow::denied_focus_and_not_transient, _MetaWindow::desc, _MetaWindow::display, find_most_freespace(), _MetaDisplay::focus_window, META_DEBUG_PLACEMENT, meta_rectangle_intersect(), meta_window_same_application(), _MetaWindow::rect, and _MetaWindow::wm_state_modal.

Referenced by meta_window_place().

Here is the call graph for this function:

◆ center_rect_in_area()

void center_rect_in_area ( MetaRectangle *  rect,
MetaRectangle *  work_area 
)

◆ center_tile_rect_in_area()

static void center_tile_rect_in_area ( MetaRectangle *  rect,
MetaRectangle *  work_area 
)
static

◆ find_first_fit()

static gboolean find_first_fit ( MetaWindow *  window,
MetaFrameBorders *  borders,
GList *  windows,
int  xinerama,
int  x,
int  y,
int *  new_x,
int *  new_y 
)
static

◆ find_most_freespace()

static void find_most_freespace ( MetaWindow *  window,
MetaFrameBorders *  borders,
MetaWindow *  focus_window,
int  x,
int  y,
int *  new_x,
int *  new_y 
)
static

References _MetaRectangle::height, META_BOTTOM, META_LEFT, META_RIGHT, META_TOP, meta_window_get_outer_rect(), meta_window_get_work_area_current_xinerama(), _MetaFrameBorders::visible, _MetaRectangle::width, _MetaRectangle::x, and _MetaRectangle::y.

Referenced by avoid_being_obscured_as_second_modal_dialog(), and meta_window_place().

Here is the call graph for this function:

◆ find_next_cascade()

static void find_next_cascade ( MetaWindow *  window,
MetaFrameBorders *  borders,
GList *  windows,
int  x,
int  y,
int *  new_x,
int *  new_y 
)
static

◆ leftmost_cmp()

static gint leftmost_cmp ( gconstpointer  a,
gconstpointer  b 
)
static

◆ meta_window_place()

void meta_window_place ( MetaWindow *  window,
MetaFrameBorders *  borders,
int  x,
int  y,
int *  new_x,
int *  new_y 
)

References avoid_being_obscured_as_second_modal_dialog(), _MetaWindow::decorated, _MetaWindow::denied_focus_and_not_transient, _MetaWindow::desc, _MetaWindow::display, find_first_fit(), find_most_freespace(), find_next_cascade(), _MetaDisplay::focus_window, _MetaWindow::fullscreen, _MetaWindow::has_maximize_func, _MetaRectangle::height, _MetaWindow::maximize_horizontally_after_placement, _MetaWindow::maximize_vertically_after_placement, META_DEBUG_PLACEMENT, meta_display_list_windows(), meta_display_lookup_x_window(), META_PLACEMENT_MODE_MANUAL, META_PLACEMENT_MODE_POINTER, meta_prefs_get_center_new_windows(), meta_prefs_get_disable_workarounds(), meta_prefs_get_placement_mode(), meta_rectangle_intersect(), meta_screen_get_current_xinerama(), META_WINDOW_DESKTOP, META_WINDOW_DIALOG, META_WINDOW_DOCK, meta_window_get_outer_rect(), meta_window_get_position(), meta_window_get_work_area_for_xinerama(), META_WINDOW_MENU, META_WINDOW_MODAL_DIALOG, META_WINDOW_NORMAL, meta_window_showing_on_its_workspace(), META_WINDOW_SPLASHSCREEN, META_WINDOW_TOOLBAR, META_WINDOW_UTILITY, NULL, _MetaXineramaScreenInfo::number, _MetaScreen::number, _MetaWindow::on_all_workspaces, place_by_pointer(), placement_mode, _MetaXineramaScreenInfo::rect, _MetaWindow::rect, _MetaWindow::screen, _MetaWindow::size_hints, TRUE, _MetaWindow::type, _MetaFrameBorders::visible, _MetaRectangle::width, windows, _MetaWindow::workspace, _MetaRectangle::x, _MetaWindow::xtransient_for, and _MetaRectangle::y.

Referenced by place_window_if_needed().

Here is the call graph for this function:

◆ northwestcmp()

static gint northwestcmp ( gconstpointer  a,
gconstpointer  b 
)
static

◆ place_by_pointer()

◆ rectangle_overlaps_some_window()

static gboolean rectangle_overlaps_some_window ( MetaRectangle *  rect,
GList *  windows 
)
static

References FALSE, meta_rectangle_intersect(), META_WINDOW_DESKTOP, META_WINDOW_DIALOG, META_WINDOW_DOCK, meta_window_get_outer_rect(), META_WINDOW_MENU, META_WINDOW_MODAL_DIALOG, META_WINDOW_NORMAL, META_WINDOW_SPLASHSCREEN, META_WINDOW_TOOLBAR, META_WINDOW_UTILITY, NULL, TRUE, _MetaWindow::type, and windows.

Referenced by find_first_fit().

Here is the call graph for this function:

◆ topmost_cmp()

static gint topmost_cmp ( gconstpointer  a,
gconstpointer  b 
)
static