1
0
Fork 0
Commit graph

143 commits

Author SHA1 Message Date
Elijah Newren
e66919510f Fix some fallout from #426519; update user_rect for all position changes
2007-04-17  Elijah Newren  <newren gmail com>

	Fix some fallout from #426519; update user_rect for all position
	changes prior to the window being marked as placed.  Prevents
	emacs in particular from flickering on start and always being
	shoved to the upper-left corner.

	* src/window.c (meta_window_move_resize_internal):
	Record position in user_rect if the window is not yet marked as
	placed too

	* src/window.c (struct MetaWindow, meta_window_new_with_attrs,
	  meta_window_move_resize_internal):
	Remove window->user_has_move_resized; it's not needed or used
	anymore.

	* src/window.[ch] (meta_window_get_user_position):
	Remove this function as it is no longer needed or used.

svn path=/trunk/; revision=3203
2007-04-18 05:43:42 +00:00
Elijah Newren
b8f89db4d1 Add support for _NET_MOVERESIZE_WINDOW. #344521.
2007-04-09  Elijah Newren  <newren gmail com>

	Add support for _NET_MOVERESIZE_WINDOW.  #344521.

	* src/display.c (handle_net_moveresize_window, event_callback):
	Remove handle_net_moveresize_window() and the call to it; this
	code was highly buggy, though to be fair it was never tested and
	had simply been put into the code in commented out form.

	* src/screen.c (set_supported_hint):
	add atom_net_moveresize_window

	* src/window.[ch]:
	(meta_window_configure_request, meta_window_move_resize_request):
	Split out the moving/resize part of the configure request and put
	it into meta_window_move_resize_request

	(meta_window_client_message):
	check for NET_MOVERESIZE_WINDOW messages and call
	meta_window_move_resize_request() with the appropriate parameters
	to handle them

	(meta_window_move_resize_internal):
	fix some of the big comment at this function -- it wasn't quite
	right, use the passed in gravity instead of
	window->size_hints.win_gravity when calling adjust_for_gravity()
	to make sure the correct adjustments are used.

	(meta_window_get_gravity_position,
	 meta_window_get_geometry, meta_window_move_resize_request):
	add a gravity parameter to meta_window_get_gravity_position and
	have it use that gravity instead of window->size_hints.win_gravity

svn path=/trunk/; revision=3186
2007-04-09 23:00:55 +00:00
Elijah Newren
addf369006 Fix move/resize events in relation to combinations of ConfigureRequest and
2007-04-08  Elijah Newren  <newren gmail com>

	Fix move/resize events in relation to combinations of
	ConfigureRequest and WM_NORMAL_HINTS change notifications (plus a
	few code cleanups).  Fixes #426519.

	* src/window.c (meta_window_move_resize_now):
	move to the user_rect position, not some weird combination of rect
	and user_rect

	* src/window.c (meta_window_configure_request):
        set user_rect in response to ConfigureRequest events (after the
	ConfigureRequest values have been constrained) and add a big
	comment explaining this change, remove unused only_resize variable
	and irrelevant huge FIXME comment about it

	* src/window.[ch] (meta_window_get_client_root_coords):
	new function

	* src/display.c (meta_display_begin_grab_op):
	* src/keybindings.c (process_keyboard_move_grab):
	* src/window.c (meta_window_unmaximize,
	  meta_window_move_resize_internal, meta_window_begin_wireframe,
	  update_move, meta_window_refresh_resize_popup,
	  warp_grab_pointer)
	combine multi-step client rect root coord setting into a single
	function call to meta_window_get_client_root_coords()

svn path=/trunk/; revision=3181
2007-04-09 03:43:55 +00:00
Elijah Newren
08f51fdf94 Patch from Carlo Wood to fix handling of unidirectional maximization and
2007-04-02  Elijah Newren  <newren gmail com>

	Patch from Carlo Wood to fix handling of unidirectional
	maximization and partial struts.  #358311.

	* src/constraints.c (constrain_maximization):
	determine target size for unidirectionally maximized windows by
	determining how far they can be maximized without hitting
	orthogonal struts.  Avoids weird "empty spaces".

	* src/boxes.[ch] (meta_rectangle_expand_to_avoiding_struts):
	new function

2007-04-02  Elijah Newren  <newren gmail com>

	Make the strut lists (stored in workspaces) record both the
	rectangle and the side that the strut is on.  Lots of code
	cleanups relating to struts.

	* src/boxes.h (struct MetaStrut):
	new struct for struts

	* src/window.[ch] (struct MetaStruts, struct MetaWindow,
	  meta_window_update_struts):
	overhaul to make window's struts remember their side as well as
	their rectangular location, and just use a list instead of several
	copies of near-identical code for left/right/top/bottom (allowing
	us to nuke MetaStruts struct as well)
	
	* src/testboxes.c (new_meta_strut, get_strut_list):
	* src/workspace.c (ensure_work_areas_validated):
	* src/boxes.c (meta_rectangle_get_minimal_spanning_set_for_region,
	  meta_rectangle_expand_to_avoiding_struts,
	  get_disjoint_strut_rect_list_in_region, fix_up_edges,
	  meta_rectangle_find_onscreen_edges,
	  meta_rectangle_find_nonintersected_xinerama_edges):
	modify to handle struts being rectangle + side instead of just rectangle

	* src/workspace.c (ensure_work_areas_validated):
	simplify strut list creation considerably given MetaWindow change,
	modify work_area computations to take advantage of region
	computations being done (makes the code shorter as well as more
	robust against pathological cases).

	* src/util.[ch] (meta_free_gslist_and_elements):
	new convenience function

	* src/common.h (enum MetaDirection):
	* src/edge-resistance.c (movement_towards_edge):
	* src/boxes.c (meta_rectangle_edge_aligns,
	  rectangle_and_edge_intersection, split_edge):
	Add more MetaDirection fields for convenience

	* src/boxes.h (enum FixedDirections):
	* src/constraints.c (setup_constraint_info, place_window_if_needed):
	add a FIXED_DIRECTION_NONE to the FixedDirections enum to make
	code more clear

svn path=/trunk/; revision=3144
2007-04-03 03:41:10 +00:00
Elijah Newren
6e007baaa8 Add support for _NET_WM_USER_TIME_WINDOW in order to cut down on context
2007-03-30  Elijah Newren  <newren gmail com>

	Add support for _NET_WM_USER_TIME_WINDOW in order to cut down on
	context switches.

	* src/display.c (meta_display_open):
	* src/display.h (struct _MetaDisplay):
	* src/screen.c (set_supported_hint):
	new atom

	* src/display.c (meta_display_open,
	  meta_display_get_current_time_roundtrip):
	* src/display.h (struct _MetaDisplay):
	create a dedicated timestamp pinging window instead of reusing
	display->leader_window

	* src/display.c (event_callback):
	* src/window-props.c (reload_net_wm_user_time_window):
	* src/window.c (meta_window_new_with_attrs, meta_window_free,
	  process_property_notify):
	* src/window.h (struct _MetaWindow):
	monitor property notify events on _NET_WM_USER_TIME_WINDOW windows too
	
	* src/window-props.[ch]:
	new meta_window_reload_propert(y|ies)_from_xwindow() functions

	* src/window-props.[ch]
	  (init_net_wm_user_time_window, reload_net_wm_user_time_window,
	  meta_display_init_window_prop_hooks):
	* src/window.c (meta_window_new_with_attrs):
	new hooks to handle new atom

svn path=/trunk/; revision=3134
2007-03-31 05:19:41 +00:00
Carlo Wood
d79a571d0a Fix cases when titlebar is allowed offscreen and shouldn't be (and
2006-10-13  Carlo Wood <carlo@alinoe.com>

	Fix cases when titlebar is allowed offscreen and shouldn't be (and
	vice-versa).  #333995.

	* src/display.[ch] (struct _MetaDisplay): add grab_frame_action
	member

	* src/display.[ch] (meta_display_begin_grab_op):
	* src/window.[ch] (meta_window_begin_grab_op):
	* src/core.[ch] (meta_core_begin_grab_op):
	Add frame_action parameter (core & window versions pass it on to
	display)

	* src/display.c (event_callback):
	* src/window.c (meta_window_begin_grab_op,
	  meta_window_client_message, menu_callback):
	* frames.c (meta_frames_button_press_event):
	* keybindings.c (do_choose_window, handle_begin_move,
	  handle_begin_resize, handle_workspace_switch):
	Pass whether the action should be considered a 'frame_action',
	which will be used to determine whether to force the titlebar to
	remain onscreen, to meta_*_begin_grab_op

	* constraints.c (constrain_titlebar_visible):
	Replace previous ugly hack by using grab_frame_action (and whether
	the action is a user action) to determine whether to enforce the
	titlebar_visible constraint.
2006-10-13 00:28:34 +00:00
Thomas James Alexander Thurman
90359a5346 Added "above" to the list of flags a frame can have, so that we know when
* common.h: Added "above" to the list of flags a frame can have, so
	that we know when to mark it as always on top.  Added six grab ops,
	one to do and one to undo each of the three new titlebar buttons
	(shade, above, stick).  Added six new button functions, similarly.
	(#96229)

        * frame.c (meta_frame_get_flags): If a frame has the WM_STATE_ABOVE X
         attribute, set META_FRAME_ABOVE in its flags.

        * frames.c (meta_frames_apply_shapes): Allow variable amounts of
         rounding. (#113162)

        * frames.c (show_tip_now, meta_frames_paint_to_drawable, control_rect,
	 get_control): extend handling of existing buttons to the
         3*2 new kinds of button. (#96229)

        * frames.c (meta_frames_button_press_event): translate clicks on the 3*2
         new kinds of button to the new grab ops. (#96229)

        * frames.c (meta_frames_button_release_event): implement the various
        actions for the 3*2 new kinds of button. (#96229)

        * frames.c (meta_frames_update_prelit_control,
         meta_frames_motion_notify_event): extend existing motion
         notifications for buttons to the 3*2 new kinds of button. (#96229)

        * frames.c (meta_frames_set_window_background): handle specified
         background colours and alpha transparency. (#151261)

        * frames.h (MetaFrameControl): New control types for the 3*2 new kinds
	 of button.  (#96229)

        * iconcache.[ch] (meta_read_icons): use theme's fallback icons if a
	 window has no icon; use metacity's fallback icons only if the theme
         does not provide any. (#11363)

        * iconcache.[ch] (meta_invalidate_default_icons (new function)): clear
         icon cache on windows using default icons, and update them. (#11363)

        * main.c (main): added \n to error message.

        * prefs.c (button_function_from_string): extend for 3 new button
	 types. (#96229)

        * prefs.c (button_opposite_function (new function)): return a button
         function's inverse (shade -> unshade, etc) (#96229)

        * prefs.c (update_button_layout): allocate space for a button's
	 inverse, if it has one. (#96229)

        * theme-parser.c (ParseState): add state for fallback icons (#11363)

        * theme-parser.c (ParseInfo): add format_version; remove
         menu_icon_* (#114305)

        * theme-parser.c (parse_positive_integer): add lookup for integer
	 constants (#331356)

        * theme-parser.c (parse_rounding (new function)): parse window
	 rounding amount (#113162)

        * theme-parser.c (parse_alpha): don't set error if the number can't
	 be parsed since it'll already be set; change tolerance in comparison
	 from 1e6 to 1e-6

        * theme-parser.c (parse_color (new function)): parse colour, including
	 possible constant lookup.

        * theme-parser.c (parse_toplevel_element): allow defining of various
	new kinds of constant; allow
	hide_buttons (#121639) and more detailed rounding attributes on
	<frame_geometry> (#113162); allow background and alpha attributes on
	<frame_style>; (#151261) remove support for <menu_icon> except as
	stub; (#114305) add support for loading stock images (#113465); add
        support for <fallback>. (#11363))

        * theme-parser.c (parse_draw_op_element): add from and to attribute
         for arcs. (#121603)

        * theme-parser.c (parse_style_element): add check for theme version
         supporting a button function. (#96229)

        * theme-parser.c (parse_style_set_element): add ability for shaded
	 windows to be resizable (#114304)

        * theme-parser.c (meta_theme_load): add theme versioning routine.

        * theme.c ( meta_frame_layout_get_borders): return rectangles for
	 the new 3*2 kinds of button, except where they're
         inapplicable. (#96229)

        * theme.c (meta_frame_layout_calc_geometry): don't format buttons on
	windows with no buttons (#121639); strip the 3*2 new kinds of button
	correctly (#96229); allow variable amounts of rounding (#113162).

        * theme.c (meta_frame_style_new): set alpha to 255 by
        default. (#151261)

        * theme.c (meta_frame_style_unref): free colour spec if
        allocated. (#151261)

        * theme.c (meta_frame_style_validate): it's only an error not to
        include a button if that button is valid in the current
        theme. (#96229)

        * theme.c (button_rect): return rectangles for the new 3*2 kinds
	of button. (#96229)

        * theme.c (meta_frame_style_set_unref): free differently resizable
	shaded styles. (#114304)

        * theme.c (get_style): look up differently resizable styles
        for shaded windows. (#114304)

        * theme.c (free_menu_ops (removed function), get_menu_icon
	 (removed function), meta_theme_draw_menu_icon (removed function),
         meta_menu_icon_type_from_string (removed function),
         meta_menu_icon_type_to_string (removed function),
         meta_theme_free, meta_theme_validate): removed menu icon code. (#114305)

        * theme.c (meta_theme_load_image): add size_of_theme_icons
	parameter. (#113465)

        * theme.c (meta_theme_define_color_constant (new function),
        meta_theme_lookup_color_constant (new function)): allow
        definition of colour constants. (#129747)

        * theme.c (meta_button_type_from_string, meta_button_type_to_string):
        add the 3*2 new kinds of button. (#96229)

        * theme.c (meta_theme_earliest_version_with_button (new function)):
        return the theme version each button was introduced in. (#96229)

        * theme.h ( MetaFrameLayout): add "hide_buttons" flag (#121639) and
	corner radiuses. (#113162)

        * theme.h (MetaFrameGeometry): add rectangles for the 3*2 new
	buttons. (#96229)

        * theme.h (MetaButtonType): the 3*2 new buttons. (#96229)

        * theme.h (MetaFrameStyle): add window_background_color and
        window_background_alpha so that we can specify background on a
        <frame_style>. (#151261)

        * theme.h (MetaFrameStyleSet): shaded_styles gets resize
	dimension. (#114304)

        * theme.h (MetaTheme): added format_version, color_constants
        hash, (#129747) fallback_icon and fallback_mini_icon, (#11363)
        and removed menu_icons. (#114305)

        * theme.h (META_THEME_ALLOWS (new macro)): return whether a theme
        supports a given feature. Also, several macros representing
        new features in v2.

        * ui.c (meta_ui_set_current_theme)): also invalidate default
        icons. (#11363)

        * window.[ch] (meta_window_update_icon_now)): became
	non-static. (#11363)
2006-10-07 16:56:47 +00:00
Elijah Newren
0201fcfc6c Stick an emacs comment directive at the beginning of all the code files so
2006-10-01  Elijah Newren  <newren gmail com>

	* src/*.[ch]: Stick an emacs comment directive at the beginning of
	all the code files so that people using emacs will be more likely
	to get coding style correct in their patches.  We still need a
	similar vi directive.  #358866
2006-10-01 22:30:10 +00:00
Elijah Newren
07e4cacf14 Patch from Carlo Wood to ensure that maximized and minimized properties
2006-10-01  Elijah Newren  <newren gmail com>

	Patch from Carlo Wood to ensure that maximized and minimized
	properties are maintained across restarts.  #358042.

	* src/constraints.c (place_window_if_needed): fix up partial
	maximization handling and add minimize_after_placement handling.

	* src/display.[ch] (struct MetaDisplay, meta_display_open): add a
	new display->display_opening flag to allow handling startup
	differently where needed.

	* src/window-props.c (reload_net_wm_state): handle
	_net_wm_state_hidden as well, setting
	window->minimize_after_placement appropriately

	* src/window.[ch] (struct MetaWindow, meta_window_new_with_attrs):
	add a window->minimize_after_placement field

	* src/window.c (meta_window_new_with_attrs): only unminimize the
	window and its transients if the display isn't being opened,
	(unmaximize_window_before_freeing): don't reset the state unless
	the window is becoming withdrawn, if the screen is being closed be
	sure to save the unmaximized state of the window so the next
	window manager can restore it
2006-10-01 21:59:09 +00:00
Elijah Newren
5c587726ae Partial audit to fix timestamp usage. One step towards fixing #355180; see
2006-09-18  Elijah Newren  <newren gmail com>

	Partial audit to fix timestamp usage.  One step towards fixing
	#355180; see important comments in that bug.

	* src/core.[ch] (meta_core_unshade, meta_core_shade):
	* src/delete.c (meta_window_present_delete_dialog,
	  delete_ping_timeout_func):
	* src/display.[ch] (meta_display_open, meta_display_close,
	  event_callback, meta_display_begin_grab_op,
	  process_selection_clear, meta_display_unmanage_screen,
	  meta_display_unmanage_windows_for_screen):
	* src/frames.c (meta_frames_button_press_event):
	* src/keybindings.c (handle_toggle_shade):
	* src/main.c (main):
	* src/screen.[ch] (update_num_workspaces, meta_screen_new,
	  meta_screen_free, prefs_changed_callback):
	* src/window.[ch] (meta_window_free, finish_minimize,
	  implement_showing, meta_window_show, meta_window_maximize,
	  meta_window_make_fullscreen_internal,
	  meta_window_unmake_fullscreen, meta_window_shade,
	  meta_window_unshade, window_activate, send_sync_request,
	  meta_window_client_message, menu_callback,
	  meta_window_update_keyboard_resize):
	Remove usage of CurrentTime, meta_display_get_current_time() and
	meta_display_get_current_time_roundtrip() where possible, or
	document why it isn't possible, or at very least add a FIXME with
	some explanation of my laziness and what needs to be done.
2006-09-18 17:27:24 +00:00
Elijah Newren
3b0478776d Fix issues on 64-bit machines with timestamps by using guint32 (like gtk+
2006-09-13  Elijah Newren  <newren gmail com>

	* src/common.h (MetaWindowMenuFunc):
	* src/core.[ch] (meta_core_user_lower_and_unfocus,
	  meta_core_user_focus, meta_core_show_window_menu,
	  meta_core_begin_grab_op, meta_core_end_grab_op):
	* src/delete.c (delete_ping_reply_func, delete_ping_timeout_func,
	  meta_window_delete):
	* src/display.[ch] (struct MetaDisplay, struct MetaPingData,
	  sanity_check_timestamps, meta_display_open, event_callback,
	  meta_spew_event, meta_display_set_grab_op_cursor,
	  meta_display_begin_grab_op, meta_display_end_grab_op,
	  meta_display_ping_timeout, meta_display_ping_window,
	  process_pong_message, timestamp_too_old,
	  meta_display_set_input_focus_window):
	* src/keybindings.[ch] (grab_keyboard, ungrab_keyboard,
	  meta_screen_grab_all_keys, meta_window_grab_all_keys,
	  meta_window_ungrab_all_keys, error_on_generic_command,
	  error_on_command, error_on_terminal_command):
	* src/metacity-dialog.c (on_realize, warn_about_no_sm_support,
	  error_about_command, main):
	* src/screen.[ch] (struct _MetaScreen, meta_screen_new,
	  meta_screen_show_desktop, meta_screen_apply_startup_properties):
	* src/session.c (warn_about_lame_clients_and_finish_interact):
	* src/window.[ch] (struct _MetaWindow,
	  intervening_user_event_occurred, window_activate,
	  meta_window_delete, meta_window_focus,
	  meta_window_send_icccm_message, meta_window_client_message,
	  menu_callback, meta_window_show_menu, struct EventScannerData,
	  check_use_this_motion_notify, meta_window_begin_grab_op,
	  meta_window_set_user_time):
	* src/workspace.[ch] (focus_ancestor_or_mru_window,
	  meta_workspace_activate_with_focus, meta_workspace_activate,
	  meta_workspace_focus_default_window,
	  focus_ancestor_or_mru_window):
	Fix issues on 64-bit machines with timestamps by using guint32
	(like gtk+ does) instead of Time.  #348305
2006-09-13 16:32:33 +00:00
Elijah Newren
4c96afba71 Fix several bugs with handling of fullscreen windows, causing them to not
2006-08-21  Elijah Newren  <newren gmail com>

	Fix several bugs with handling of fullscreen windows, causing them
	to not actually be fullscreen.  #343115 (and also #346927,
	#350547, #351643, the recent additional WINE-related issue
	mentioned on the mailing list, and probably others...)

	* src/constraints.c (setup_constraint_info): if a window tries to
	resize to fullscreen-size and it has a fullscreen function but
	isn't actually marked as fullscreen then assist it by marking it
	as such, (constrain_fully_onscreen, constrain_titlebar_visible):
	ignore this constraint for fullscreen windows since such windows
	have a separate specialized constraint

	* src/stack.c (window_is_fullscreen_size, get_standalone_layer):
	remove the old window_is_fullscreen_size() hack for detecting
	windows to treat as fullscreen since it doesn't work well with the
	new constraints framework (i.e. we needed a slightly different
	hack)

	* src/window.[ch] (meta_window_new_with_addrs): shuffle the order
	of adding the window to the stack and moveresizing the window
	since moveresizing can cause stack changes if the window's initial
	size is fullscreen size, (meta_window_make_fullscreen,
	meta_window_make_fullscreen_internal): split
	meta_window_make_fullscreen() similar to meta_window_maximize() so
	that constraints can make use of it
2006-08-21 18:08:05 +00:00
Elijah Newren
57bedc42a4 Add a constrain_titlebar_visible constraint; should fix both bug 333328
2006-08-07  Elijah Newren  <newren gmail com>

	Add a constrain_titlebar_visible constraint; should fix both bug
	333328 and bug 345522.  Not perfect (minor annoying snap pulling
	windows back onscreen, plus an ugly hack almost as bad as the old
	one), but tarballs are due in less than half an hour.  ;-)

	* src/boxes.[ch] (meta_rectangle_overlaps_with_region):
	new function

	* src/constraints.c (constrain_titlebar_visible): new function,
	  (enum ConstraintPriority, array all_constraints,
	  update_onscreen_requirements): various small changes to
	  accomodate the new function

	* src/edge-resistance.c: remove the infinite edge resistance,
	which was a big hack of a way to workaround the lack of a
	titlebar_visible constraint

	* src/window.[ch] (MetaWindow): new require_titlebar_visible
	bitfield, (meta_window_new_with_attrs): initialized here
2006-08-07 23:34:55 +00:00
Elijah Newren
adc46fc970 Patch from Vytautas Liuolia to react to _NET_STARTUP_ID changes, as
2006-08-07  Elijah Newren  <newren gmail com>

	Patch from Vytautas Liuolia to react to _NET_STARTUP_ID changes,
	as proposed for the new startup-notification/EWMH spec.  #347515

	* src/window-props.c (reload_net_startup_id): be sure to act on
	the new id instead of just recording it

	* src/window.[ch] (window_activate, meta_window_activate,
	  meta_window_activate_with_workspace, meta_window_client_message):
	change window_activate() to take a workspace parameter instead of
	hardcoding to the current workspace, add
	meta_window_activate_with_workspace() function needed by
	reload_net_startup_id().
2006-08-07 18:08:27 +00:00
Søren Sandmann
4a06163710 Run an unminimize effect
Fri May 26 16:48:29 2006  Søren Sandmann  <sandmann@redhat.com>

        * src/effects.c (meta_effect_run_unminimize): Run an unminimize effect

        * src/window.c (meta_window_unminimize): Store a "was_minimized"
        boolean in the window.

        * src/window.c (meta_window_show): If the window was minimized,
        run an unminimize animation.

        * src/c-window.c (meta_comp_window_run_unminimize): Add an
        unminimize animation, running the minimize one in reverse.
2006-05-26 20:50:34 +00:00
Elijah Newren
b62dd8d130 Clear _NET_WM_VISIBLE_NAME (and the ICON_ equivalent) when no longer being
2006-04-25  Elijah Newren  <newren gmail com>

	Clear _NET_WM_VISIBLE_NAME (and the ICON_ equivalent) when no
	longer being used.  Fixes #330671.

	* src/window.[ch] (struct MetaWindow): new
	using_net_wm_visible_name and using_net_wm_visible_icon_name bits,
	(meta_window_new_with_attrs): initialize these new bits to false

	* src/window-props.c (set_title_text, set_window_title, set_icon_title):
	if the _NET_WM_VISIBLE_(ICON_)NAME property was previously set but
	doesn't need to be this time, make sure to clear it
2006-05-05 01:10:20 +00:00
Thomas Thurman
2214fd75d9 Add a tabbing function, bound to alt-f6 by default, to cycle through the
2006-04-14  Thomas Thurman   <thomas@thurman.org.uk>

        Add a tabbing function, bound to alt-f6 by default, to cycle
        through the windows of the current application. Fixes #164831.

        * src/common.h: two new MetaGrabOpts values for group switching
        * src/display.c (ping_data_free, meta_display_in_grab_op,
        IN_TAB_CHAIN): adapt to new MetaGrabOpts
        * src/display.h: new enum value for MetaTabList for group switching
        * src/keybindings.c (meta_display_process_key_event):
        adapt to new MetaGrabOpts
        (process_tab_grab): adapt to new MetaGrabOpts, and use switch
        statement for cancelling instead of if statement
        * src/metacity.schemas.in: new keybindings
        * src/prefs.c, src/prefs.h: handle new keybindings
        * src/window.h: define META_WINDOW_IN_GROUP_TAB_CHAIN macro
2006-04-15 02:05:44 +00:00
Elijah Newren
127a89886b Fix grouping in the presence of ancestors; caught by Björn. #336184
2006-03-29  Elijah Newren  <newren gmail com>

	Fix grouping in the presence of ancestors; caught by Björn.
	#336184

	* src/group.c (meta_window_compute_group): Use new
	meta_window_find_root_ancestor() function to get ancestor; for the
	computed group, use the ancestor's group instead of the ancestor
	itself

	* src/window.[ch] (meta_window_find_root_ancestor,
	meta_window_raise): split meta_window_find_root_ancestor()
	functionality of meta_window_raise() and make it available
	elsewhere
2006-03-30 19:22:38 +00:00
Thomas Thurman
cf3deef6ea mark a window as needing or not needing the user's attention use the new
2006-03-29  Thomas Thurman   <thomas@thurman.org.uk>
        * src/window.c, src/window.h (meta_window_set_demands_attention,
        meta_window_unset_demands_attention): mark a window as needing
        or not needing the user's attention
        * src/window.c (meta_window_show, window_activate,
        meta_window_focus, meta_window_configure_request,
        meta_window_client_message): use the new set/unset
        demands attention functions. Fixes #305822.
2006-03-29 18:43:22 +00:00
Thomas Thurman
25923105e4 deleted and moved into window-props.c (meta_window_new_with_attrs): added
2006-03-25  Thomas Thurman  <thomas@thurman.org.uk>

	* src/window.c, src/window.h (update_net_wm_state,
	update_mwm_hints, update_wm_class, update_transient_for):
	deleted and moved into window-props.c
	(meta_window_new_with_attrs): added constructing field
	and four new initial properties (as above)
	(meta_window_recalc_features,
	meta_window_recalc_window_type): new functions

	* src/window-props.c (init_net_wm_state, reload_net_wm_state
	init_mwm_hints, reload_mwm_hints, init_wm_class,
	reload_mwm_class, init_transient_for, reload_transient_for):
	new functions, moved in from window.c

	(meta_display_init_window_prop_hooks): initialise new properties
2006-03-25 22:57:22 +00:00
Elijah Newren
5913b8c5ab Whoops, I forgot to keep my copyright info updated with my previous
2006-01-10  Elijah Newren  <newren@gmail.com>

	* src/bell.c:
	* src/boxes.c:
	* src/boxes.h:
	* src/constraints.c:
	* src/core.c:
	* src/display.c:
	* src/display.h:
	* src/edge-resistance.c:
	* src/frames.c:
	* src/keybindings.c:
	* src/main.c:
	* src/prefs.c:
	* src/prefs.h:
	* src/screen.c:
	* src/screen.h:
	* src/window.c:
	* src/window.h:
	Whoops, I forgot to keep my copyright info updated with my previous
	commits as Havoc had asked me to do.  Doing that now...
2006-01-10 19:43:21 +00:00
Elijah Newren
f6270596de Don't "steal" focus from terminal windows for new window mappings as the
2006-01-10  Elijah Newren  <newren@gmail.com>

	Don't "steal" focus from terminal windows for new window mappings
	as the difference in usage between terminals and other apps seems
	to suggest this difference in treatment.  See #326159 for details,
	feedback welcome.

	* src/window.[ch] (__window_is_terminal): New function, currently
	an ugly hack and should be replaced by a new property set by
	applications if the behavior works to our liking,
	(window_state_on_map): don't transfer focus to new windows from
	terminals unless the new window is a transient of the focused
	terminal

	* src/keybindigns.c (handle_panel_keybinding): panel run dialog
	keybinding should be counted as an explicit transfer of focus to
	the new window, so override the
	don't-transfer-focus-from-terminals in this case
2006-01-10 18:33:53 +00:00
Elijah Newren
a4d1c6fd61 More thorough handling of source indication. Part of #326041.
2006-01-09  Elijah Newren  <newren@gmail.com>

	More thorough handling of source indication.  Part of #326041.

	* src/window.c (window_activate): new function based off the old
	meta_window_activate but which also takes source indication into
	account, (meta_window_active): just call window_activate() with
	the necessary source indication to get the behavior wanted,
	(meta_window_client_message): check source indication too for
	_net_active_window messages

	* src/window.h (enum MetaClientType): convenience enum for source
	indication handling
2006-01-10 05:44:40 +00:00
Elijah Newren
0f8add8b37 Make the taskbar less flash happy and fix up some related stacking issues.
2006-01-09  Elijah Newren  <newren@gmail.com>

	Make the taskbar less flash happy and fix up some related stacking
	issues.  #326035.

	* src/window.c (windows_overlap): new function,
	(meta_window_show): if a window is denied focus but doesn't
	overlap with the focus window there is no need to set the demands
	attention hint nor stack that window below the focus window,
	(meta_window_get_outer_rect): we're not modifying the window so
	declare it to be const
2006-01-10 05:14:48 +00:00
Elijah Newren
a7201d27d1 Merge of all the changes on the constraints_experiments branch. This is
2005-11-18  Elijah Newren  <newren@gmail.com>

	Merge of all the changes on the constraints_experiments branch.
	This is just a summary, to get the full ChangeLog of those
	changes (approx. 2000 lines):
	  cvs -q -z3 update -Pd -r constraints_experiments
	  cvs -q -z3 diff -pu -r CONSTRAINTS_EXPERIMENTS_BRANCHPOINT ChangeLog

	Bugs fixed:
	  unfiled - constraints.c is overly complicated[1]
	  unfiled - constraints.c is not robust when all constraints
	            cannot simultaneously be met (constraints need to be
	            prioritized)
	  unfiled - keep-titlebar-onscreen constraint is decoration
	            unaware (since get_outermost_onscreen_positions()
	            forgets to include decorations)
	  unfiled - keyboard snap-moving and snap-resizing snap to hidden
	            edges
	   109553 - gravity w/ simultaneous move & resize doesn't work
	   113601 - maximize vertical and horizontal should toggle and be
	            constrained
	   122196 - windows show up under vertical panels
	   122670 - jerky/random resizing of window via keyboard[2]
	   124582 - keyboard and mouse snap-resizing and snap-moving
	            erroneously moves the window multidimensionally
	   136307 - don't allow apps to resize themselves off the screen
	            (*cough* filechooser *cough*)
	   142016, 143784 - windows should not span multiple xineramas
	            unless placed there by the user
	   143145 - clamp new windows to screensize and force them
	            onscreen, if they'll fit
	   144126 - Handle pathological strut lists sanely[3]
	   149867 - fixed aspect ratio windows are difficult to resize[4]
	   152898 - make screen edges consistent; allow easy slamming of
	            windows into the left, right, and bottom edges of the
	            screen too.
	   154706 - bouncing weirdness at screen edge with keyboard moving
	            or resizing
	   156699 - avoid struts when placing windows, if possible (nasty
	            a11y blocker)
	   302456 - dragging offscreen too restrictive
	   304857 - wireframe moving off the top of the screen is misleading
	   308521 - make uni-directional resizing easier with
	            alt-middle-drag and prevent the occasional super
	            annoying resize-the-wrong-side(s) behavior
	   312007 - snap-resize moves windows with a minimum size
	            constraint
	   312104 - resizing the top of a window can cause the bottom to
	            grow
	   319351 - don't instantly snap on mouse-move-snapping, remove
	            braindeadedness of having order of releasing shift and
	            releasing button press matter so much

	   [1] fixed in my opinion, anyway.
	   [2] Actually, it's not totally fixed--it's just annoying
	       instead of almost completely unusable.  Matthias had a
	       suggestion that may fix the remainder of the problems (see
	       http://tinyurl.com/bwzuu).
	   [3] This bug was originally about not-quite-so-pathological
	       cases but was left open for the worse cases. The code from
	       the branch handles the remainder of the cases mentioned in
	       this bug.
	   [4] Actually, although it's far better there's still some minor
	       issues left: a slight drift that's only noticeable after
	       lots of resizing, and potential problems with partially
	       onscreen constraints due to not clearing any
	       fixed_directions flags (aspect ratio windows get resized in
	       both directions and thus aren't fixed in one of them)

	New feature:
	    81704 - edge resistance for user move and resize operations;
	            in particular 3 different kinds of resistance are
	            implemented:
             	 Pixel-Distance: window movement is resisted when it
	     	   aligns with an edge unless the movement is greater than
	     	   a threshold number of pixels
             	 Timeout: window movement past an edge is prevented until
	     	   a certain amount of time has elapsed during the
	     	   operation since the first request to move it past that
	     	   edge
             	 Keyboard-Buildup: when moving or resizing with the
	     	   keyboard, once a window is aligned with a certain edge
	     	   it cannot move past until the correct direction has
	     	   been pressed enough times (e.g. 2 or 3 times)

	Major changes:
	  - constraints.c has been rewritten; very few lines of code from
	    the old version remain.  There is a comment near the top of
	    the function explaining the basics of how the new framework
	    works.  A more detailed explanation can be found in
	    doc/how-constraints-works.txt
	  - edge-resistance.[ch] are new files implementing edge-resistance.
	  - boxes.[ch] are new files containing low-level error-prone
	    functions used heavily in constraints.c and edge-resistance.c,
	    among various places throughout the code.  testboxes.c
	    contains a thorough testsuite for the boxes.[ch] functions
	    compiled into a program, testboxes.
	  - meta_window_move_resize_internal() *must* be told the gravity
	    of the associated operation (if it's just a move operation,
	    the gravity will be ignored, but for resize and move+resize
	    the correct value is needed)
	  - the craziness of different values that
	    meta_window_move_resize_internal() accepts has been documented
	    in a large comment at the beginning of the function.  It may
	    be possible to clean this up some, but until then things will
	    remain as they were before--caller beware.
	  - screen and xinerama usable areas (i.e. places not covered by
	    e.g. panels) are cached in the workspace now, as are the
	    screen and xinerama edges.  These get updated with the
	    workarea in src/workspace.c:ensure_work_areas_validated()
2005-11-19 14:58:50 +00:00
Elijah Newren
29e38a2f53 Add my copyright notice to a number of files on which it should already
2005-10-08  Elijah Newren  <newren@gmail.com>

	Add my copyright notice to a number of files on which it should
	already exist.
2005-10-08 19:38:54 +00:00
Elijah Newren
12daca5cb1 Patch from Ross Cohen to make alt-esc (show windows instantly) actually
2005-10-03  Elijah Newren  <newren@gmail.com>

	Patch from Ross Cohen to make alt-esc (show windows instantly)
	actually show minimized windows too.  Fixes #107072.

	* src/keybindings.c (process_tab_grab): initialize tab_unminimized
	to FALSE for the target window when starting the grab, when
	advancing through the list check to find the previous window and
	re-minimize it if it was tab-unminimized, unminimize the new
	window we're alt-esc'ing to if it's minimized, (do_choose_window):
	raise and unminimize the initial window as well in alt-esc'ing

	* src/window.h (struct _MetaWindow): add a tab_unminimized field

	* src/window.c (meta_window_new_with_attrs): initialize
	tab_unminimized to false
2005-10-03 20:02:31 +00:00
Ray Strode
7b416a0a2d Actually commit the stuff mentioned in the last ChangeLog entry.
2005-05-26  Ray Strode  <rstrode@redhat.com>

	Actually commit the stuff mentioned in the last
	ChangeLog entry.
2005-05-26 19:58:17 +00:00
Elijah Newren
50312dd0e8 Big patch to cover about 6 different issues in order to correct rare
2005-02-20  Elijah Newren  <newren@gmail.com>

	Big patch to cover about 6 different issues in order to correct
	rare problems with timestamps (make sure window selected in
	tasklist actually gets focus, sanity check timestamps to avoid
	rogue apps hosing the system, correct the updating of
	net_wm_user_time, correctly handle timestamps of 0 when comparing
	xserver timestamps for those who have had their systems up for
	over 25 days or so, add some debugging information to verbose
	logs, some code cleanups).  Fixes all issues listed in #167358.

	* src/display.h: (struct _MetaDisplay): clarify comment on
	last_focus_time, introduce a new variable--last_user_time,
	(XSERVER_TIME_IS_BEFORE macro): put this functionality into a
	separate macro and then introduce a new macro with this name that
	uses the old one but adds additional special-case checks for
	timestamps that are 0, (comment to
	meta_display_set_input_focus_window): add information about how
	last_user_time should be used in this function

	* src/display.c (santiy_check_timestamps): new function,
	(meta_display_open): intialize display->last_user_time,
	(meta_display_get_current_time_roundtrip): use the timestamp,
	which is known to be good, in order to sanity_check_timestamps,
	(event_callback): use the new meta_window_ste_user_time() function
	in order to correct problems, use the timestamp of KeyPress and
	ButtonPress events, which are known to be good, in order to
	sanity_check_timestamps, (timestamp_too_old): new function for
	common behavior of meta_display_focus_the_no_focus_window and
	meta_display_set_input_focus_window, with added checking for
	display->last_user_time in addition to display->last_focus_time,
	(meta_display_set_input_focus_window): replace some of the code
	with a call to timestamp_too_old(),
	(meta_display_focus_the_no_focus_window): replace some of th ecode
	with a call to timestamp_too_old()

	* src/window.h: (meta_window_set_user_time): new function to
	abstract the many things that need to be done when updating the
	net_wm_user_time of any window

	* src/window.c: (meta_window_activate): add debugging spew, make
	sure the comparison is made with last_user_time NOT
	last_focus_time, use meta_window_set_user_time() function in order
	to correct problems, (meta_window_client_message): add a newline
	to a debugging message to make them easier to read,
	(meta_window_set_user_time): new function

	* src/window-props.c (reload_net_wm_user_time): use the new
	meta_window_ste_user_time() function in order to correct problems
2005-02-20 17:14:16 +00:00
Elijah Newren
d31a0829be Avoid new windows being obscured by the focus window (and thus possibly
2005-02-11  Elijah Newren  <newren@gmail.com>

	Avoid new windows being obscured by the focus window (and thus
	possibly lost).  Fixes #166524.

	* src/place.c: new MetaWindowDirection enum,
	(find_most_freespace): new function to find where there is the
	most space available around the focused window,
	(meta_window_place): if a window is denied focus and the window
	overlaps the focused window, retry the first-fit algorithm only
	paying attention to the focus window position and if that fails
	just find the location on the screen with the most space
	available.

	* src/window.h: (struct MetaWindow): new
	denied_focus_and_not_transient bitfield

	* src/window.c: (meta_window_new_with_attrs): initialize
	denied_focus_and_not_transient, (meta_window_show): set and unset
	the denied_focus_and_not_transient field appropriately
2005-02-11 19:20:44 +00:00
Elijah Newren
5389f135ce Take into account the appropriate list of windows when placing a new one.
2005-01-28  Elijah Newren  <newren@gmail.com>

	Take into account the appropriate list of windows when placing a
	new one.  Fixes #165381.

	* src/place.c: (meta_window_place): use
	meta_window_showing_on_its_workspace(w) instead of !w->minimzed,
	also take into account sticky windows

	* src/window.[ch]: rename window_showing_on_its_workspace to
	meta_window_showing_on_its_workspace and export it
2005-01-28 14:48:47 +00:00
Elijah Newren
c74ab35c6c Focus windows that manually position themselves too (fixes #107347).
2004-12-27  Elijah Newren  <newren@gmail.com>

	Focus windows that manually position themselves too (fixes
	#107347).

	* src/window.h (struct _MetaWindow): add a new
	showing_for_first_time flag

	* src/window.c (meta_window_new_with_attrs): initialize
	showing_for_first_time flag to !mapped, (meta_window_show):
	replace did_placement with showing_for_first_time in the section
	to decided whether to focus since did_placement isn't quite what
	we want
2004-12-28 06:01:42 +00:00
Elijah Newren
d5a484479f Thanks to mild7@users.sourceforge.net for this fix.
2004-12-24  Elijah Newren  <newren@gmail.com>

	Thanks to mild7@users.sourceforge.net for this fix.

	* src/window.h: (META_WINDOW_IN_NORMAL_TAB_CHAIN): Excludes
	windows with skip_taskbar hint set from the alt-tab list; they'll
	appear in the ctrl-alt-tab list instead. (fixes #106249)
2004-12-24 15:43:46 +00:00
Elijah Newren
e46fc46701 Rename meta_window_visible_on_workspace to
2004-12-22  Elijah Newren  <newren@gmail.com>

	* src/core.c (meta_core_user_lower_and_unfocus):
	* src/display.c (meta_display_get_current_tab):
	* src/stack.c (get_default_focus_window, meta_stack_list_windows):
	* src/window.c (set_net_wm_state, meta_window_should_be_showing,
	implement_showing, meta_window_activate,
	meta_window_notify_focus):
	* src/window.h:
	* src/workspace.c (meta_workspace_list_windows):

	Rename meta_window_visible_on_workspace to
	meta_window_located_on_workspace (whether or not the window was
	showing wasn't taken into account, which made "visible"
	confusing).  Fixes #136314.
2004-12-23 00:20:33 +00:00
Elijah Newren
f4f8699d84 Partially resolve the conflicting requirements of windows on multiple
2004-12-22  Elijah Newren  <newren@gmail.com>

	Partially resolve the conflicting requirements of windows on
	multiple workspaces and hidden being a global quantity for windows
	(fixes bug 156182; the remainder of the work is bug 87531 and is a
	libwnck issue)

	* src/display.c (event_callback):
	* src/window.c (meta_window_visible_on_workspace, meta_window_unstick):
	* src/workspace.c (meta_workspace_add_window,
	meta_workspace_contains_window,
	meta_workspace_queue_calc_showing):
	* src/workspace.h:

	Remove meta_workspace_contains_window, replace with simple
	comparison utilizing window->workspace

	* src/place.c (meta_window_place):
	* src/window.c (meta_window_shares_some_workspace):
	* src/window.h:

	Remove meta_window_shares_some_workspace, replace with a simple
	comparison utilizing window->workspace

	* src/session.c (save_state),
	* src/window.c (meta_window_new_with_attrs,
	meta_window_apply_session_info, meta_window_free,
	window_showing_on_its_workspace,
	meta_window_change_workspace_without_transients,
	meta_window_unstick, meta_window_set_current_workspace_hint,
	meta_window_get_workspaces):
	* src/window.h:
	* src/workspace.c (meta_workspace_free, meta_workspace_add_window,
	meta_workspace_remove_window):

	Only one workspace now
2004-12-22 23:52:52 +00:00
Elijah Newren
d178f5e330 When snap-moving, don't snap to transients of minimized windows since they
2004-12-19  Elijah Newren  <newren@gmail.com>

	When snap-moving, don't snap to transients of minimized windows
	since they are hidden.  Fixes #157180

	* src/place.c (get_windows_on_same_workspace): make the logic to
	determine hidden windows more thorough by calling
	meta_window_should_be_showing()

	* src/window.c (meta_window_should_be_showing): rename this
	function from window_should_be_showing and also export it,
	(implement_showing):
	s/window_should_be_showing/meta_window_should_be_showing/,
	(idle_calc_showing):
	s/window_should_be_showing/meta_window_should_be_showing/

	* src/window.h (meta_window_should_be_showing): Add this function
	to the list so that it can be used in src/place.c
2004-12-20 02:53:08 +00:00
Havoc Pennington
06a58f43c0 track the last_xor_rect separately from the current window size, and then
2004-08-18  Havoc Pennington  <hp@redhat.com>

	* src/display.h (struct _MetaDisplay): track the last_xor_rect
	separately from the current window size, and then use that to
	paint the wireframe including the frame, and taking into
	account shaded windows.

	* src/window.c (meta_window_get_xor_rect): new function to compute
	the xor rect; it is not really 100% right, because it uses the
	frame dimensions from the window at the start of the move/resize.
	But probably won't break in practice.
2004-08-19 02:05:24 +00:00
Elijah Newren
bd73853f72 Revert Rob's 2004-07-31 patch that ignored net_wm_user_time when
2004-08-07  Elijah Newren  <newren@math.utah.edu>

	* window.c, window.h: Revert Rob's 2004-07-31 patch that ignored
	net_wm_user_time when unminimizing a window

	* window.c (meta_window_activate): If a nonzero timestamp is
	passed, update the window's net_wm_user_time accordingly.  (see
	comments 102-108 of bug 118372)
2004-08-08 00:02:02 +00:00
Rob Adams
12f4f7c6b0 Fix bug that caused windows to not be focused on unminimizing because of
2004-07-31  Rob Adams  <readams@readams.net>

	Fix bug that caused windows to not be focused on unminimizing
	because of user time support.

	* src/window.c (meta_window_new_with_attrs): initialize
	focus_despite_user_time bit
	(window_takes_focus_on_map): focus if focus_despite_user_time
	despite user time, interestingly enough
	(meta_window_show): reset focus_despite_user_time after showing

	* src/window.h (_MetaWindow): add focus_despite_user_time bit
2004-07-31 21:26:05 +00:00
Rob Adams
e60da6c006 Fix some support for EWMH hints, and fix USER_TIME support to include the
2004-07-31  Rob Adams  <readams@readams.net>

	Fix some support for EWMH hints, and fix USER_TIME support to
	include the DEMANDS_ATTENTION hint.  Also includes some code for
	implementing _NET_RESTACK_WINDOW and _NET_MOVERESIZE_WINDOW, but
	this is disabled pending feature thaw.

	* COMPLIANCE: update with new information

	* src/display.c (meta_display_open): add new hints to list

	* src/display.h (_MetaDisplay): Add new atoms to struct

	* src/screen.c (set_supported_hint): update the list of support
	hints.
	(set_desktop_viewport_hint): new function sets the viewport hint
	to (0,0) as required by the spec for WMs with no viewport support.
	(set_desktop_geometry_hint): new function to set the desktop size
	hint to the size of the display, since we don't implement large
	desktop support, as required by the spec.
	(meta_screen_resize): update the geometry hint on screen resize

	* src/window.c (meta_window_new_with_attrs): Initialize
	demands_attention state
	(set_net_wm_state): Set demands_attention hint in the window state
	(meta_window_show): If we don't pop up a window because of
	USER_TIME, set DEMANDS_ATTENTION on the window.
	(meta_window_focus): When a window receives focus, remove
	DEMANDS_ATTENTION hint
	(meta_window_client_message): Allow other apps to set
	DEMANDS_ATTENTION on a window.  Also, if the _NET_ACTIVE_WINDOW
	hint includes a timestamp, use it.
	(update_net_wm_state): Read DEMANDS_ATTENTION state also

	* src/window.h (_MetaWindow): add wm_state_demands_attention bit.
2004-07-31 19:56:10 +00:00
Elijah Newren
28a54c6bb4 Add support for _NET_WM_USER_TIME
2004-06-17  Elijah Newren  <newren@math.utah.edu>

	Add support for _NET_WM_USER_TIME

	* src/display.c:
	(meta_display_open): Add _NET_WM_USER_TIME to atom_names[],
	(event_callback): Manually set _NET_WM_USER_TIME upon KeyPress
	(doesn't work since keyboard isn't grabbed) and ButtonPress (does
	work), this is just a fallback for applications that don't update
	this themselves.

	* src/display.h: (struct _MetaDisplay): Add atom_net_wm_user_time field

	* src/screen.c: (meta_screen_apply_startup_properties): Check for
	TIMESTAMP provided from startup sequence as well.

	* src/stack.c:
	s/meta_window_set_stack_position/meta_window_set_stack_position_no_sync/,
	(meta_window_set_stack_position): New function which calls the
	meta_window_set_stack_position_no_sync function followed immediately
	by calling meta_stack_sync_to_server.

	* src/window-props.c:
	(init_net_wm_user_time), (reload_net_wm_user_time): new functions,
	(reload_wm_hints): also load atom_net_wm_user_time

	* src/window.c:
	new XSERVER_TIME_IS_LATER macro (accounts for timestamp wraparound),
	(meta_window_new_with_attrs): add timestamp attributes,
	(window_takes_focus_on_map): use TIMESTAMP from startup
	notification and _NET_WM_USER_TIME to decide whether to focus new
	windows,
	(meta_window_show): if app doesn't take focus on map, place it
	just below the focused window in the stack
	(process_property_notify): check for changes to _NET_WM_USRE_TIME,
	(meta_window_stack_just_below): new function

	* src/window.h:
	(_MetaWindow struct): new fields for initial_timestamp,
	initial_timestamp_set, net_wm_user_time_set, and net_wm_user_time,
	(meta_window_stack_just_below): new function
2004-06-24 15:47:05 +00:00
Soeren Sandmann
4cfb5152f7 Fix bug 143333, support for update counter spec, and 109362, schedule
Sat Jun 19 02:21:08 2004  Soeren Sandmann  <sandmann@daimi.au.dk>

	Fix bug 143333, support for update counter spec, and 109362,
	schedule compensation events when events are ignored.

	* src/display.c (meta_display_open): Add _NET_WM_SYNC_REQUEST and
	_NET_WM_SYNC_REQUEST_COUNTER atoms. Remove the old
	METACITY_SYNC_COUNTER stuff.
	(meta_display_begin_op): Setup the sync counter

	* src/xprops.c, src/xprops.h, src/window-props.c, src/display.h:
	Add new atoms.

	* src/window.c (send_sync_request): new function.
	(meta_window_move_resize_internal): send a sync request before
	resizing.
	(check_move_resize_frequence): Rework logic to also check the SYNC
	case. If an event is ignored return the remaining time.
	(update_resize_timeout): Timeout that gets called when a
	compensation event is scheduled.
	(uddate_resize): schedule compensation events when an event is
	ignored.
	(meta_window_handle_mouse_grap_op_event): When an alarm is
	received and sync was turned off, turn it back on.

	* src/window.h (struct MetaWindow)  Add some variables
2004-06-19 00:45:24 +00:00
Rob Adams
56609cbb39 Revert 2/27 patch for layer promotion.
2004-02-28  Rob Adams  <readams@readams.net>

	Revert 2/27 patch for layer promotion.
2004-02-28 23:58:40 +00:00
Rob Adams
9739346c85 Handle layer promotion of transient descendants of layer-promoted windows
2004-02-27  Rob Adams  <readams@readams.net>

	Handle layer promotion of transient descendants of layer-promoted
	windows to also be layer promoted, using a simple iterative
	algorithm.

	* src/stack.c (compute_layer): change name to promote_layer, and
	convert to simply perform any necessary layer promotion without
	computing the standalone layer.
	(max_layer_func): use window->layer instead of
	get_standalone_layer
	(get_maximum_layer_of_ancestor): use window->layer instead of
	get_standalone_layer
	(meta_stack_ensure_sorted): implement iterative algorithm,
	explained in a long comment.

	* src/window.h: add a tmp_layer field used by stack.c for
	determining if the stack is dirty or not, since maintaining this
	information in meta_stack_ensure_sorted is no longer practical.
2004-02-28 01:49:17 +00:00
Rob Adams
9bde925d3d Revert prior change 2003-12-13 23:00:06 +00:00
Rob Adams
7630d22b8d Add increased robustness for dealing with all workspaces windows and MRU
2003-12-13  Rob Adams  <readams@readams.net>

	Add increased robustness for dealing with all workspaces windows
	and MRU lists.
	Also add very preliminary _NET_WM_USER_TIME
	support, limited to simply listening for the property and keeping
	an internal variable updated, and also treating some input events
	as though they were user time updates.

	* src/window.c (meta_window_new_with_attrs): set on_all_workspaces
	in all cases _before_ adding to the workspaces, so that windows
	initially on all workspaces are added correctly to the MRU lists.
	Fix for #120907.
	(process_property_notify): add net_wm_user_time support.

	* src/workspace.c (meta_workspace_add_window): handle sticky
	windows so that we add to add mru lists if needed
	(meta_workspace_remove_window): handle sticky windows so that they
	are removed from all mru lists if needed.

	* src/display.[ch] (meta_display_open): add net_wm_user_time support.
	(event_callback): simulate user time update on key and button presses.

	* src/screen.c (set_supported_hint): add net_wm_user_time support.

	* src/window-props.c (init_net_wm_user_time): new function for
	user_time support
	(reload_net_wm_user_time): new function for user_time support
	(meta_display_init_window_prop_hooks): add hook for user_time
2003-12-13 18:28:14 +00:00
Havoc Pennington
d538690bd4 new function
2003-11-20  Havoc Pennington  <hp@redhat.com>

	* src/window.c (meta_window_new_with_attrs): new function

	* src/display.c, src/screen.c: create the compositor and feed
	windows and events to it
2003-11-21 02:32:05 +00:00
Havoc Pennington
6aff3466c6 In the "prefs cause code complexity" department, here's a "sloppy focus
2003-10-13  Havoc Pennington  <hp@redhat.com>

        In the "prefs cause code complexity" department, here's a "sloppy
	focus die die die" kind of moment.

	* src/display.c (meta_display_grab_focus_window_button): don't
	grab in sloppy focus mode, since we were dropping the grab on
	window enter anyway this just removes races from the current
	behavior.

	* src/display.c (prefs_changed_callback): ungrab/grab on focus
	mode changes, since we treat sloppy and click differently.
2003-10-13 20:15:40 +00:00
Havoc Pennington
e98fad3e62 Merge reduced_resources mode patch from the branch. Offers wireframe and
2003-10-12  Havoc Pennington  <hp@redhat.com>

        Merge reduced_resources mode patch from the branch. Offers
	wireframe and no-animations.

	* src/window.c (implement_showing): no animation if we are
	in reduced resources mode

	* src/prefs.c: add REDUCED_RESOURCES pref

	* src/window.c (meta_window_update_keyboard_resize): fix to
	modify grab_anchor_window_pos to grab_wireframe_rect if
	appropriate instead of window->rect

	* src/display.h (struct _MetaDisplay): add grab_start_serial used
	to avoid responding to events that occurred prior to the grab
	initialization.

	Still broken in various ways, specifically EnterNotify that
	occurred prior to XGrabPointer is processed as if it occurred
	after.

	* src/window.c (meta_window_update_keyboard_move): add this
	instead of meta_window_warp_pointer() crack

	* src/effects.c (meta_effects_update_wireframe): draw a kind of
	grid for the wireframe, instead of just a rectangle, like twm

	* src/screen.c (meta_screen_new): line width of 3 for the XOR gc

        "Reduced resources" mode based on wireframe patch from
	Erwann Chenede. Still pretty buggy.

	* src/keybindings.c (process_keyboard_move_grab)
	(process_keyboard_resize_grab): add gruesome wireframe hacks

	* src/display.c (meta_display_end_grab_op): end wireframe
	(meta_display_begin_grab_op): begin wireframe

	* src/effects.c (meta_effects_end_wireframe)
	(meta_effects_update_wireframe, meta_effects_begin_wireframe):
	routines to draw the wireframe stuff

	* src/window.c (window_should_be_showing): hide window when
	doing wireframe, commented out as it breaks grab
	* src/window.c (meta_window_refresh_resize_popup): handle wireframe

	* src/screen.c (meta_screen_new): create a screen->root_xor_gc
	for use in drawing wireframes

	* src/frames.c (meta_frames_push_delay_exposes): repaint
	everything before we delay
2003-10-12 06:25:38 +00:00
Rob Adams
34ec58af0a Add keybinding to allow the user to toggle _NET_WM_STATE_ABOVE on windows.
2003-06-26  Rob Adams  <robadams@ucla.edu>

	Add keybinding to allow the user to toggle _NET_WM_STATE_ABOVE on
	windows.  Disabled by default.  See #98387.

	* src/keybindings.c (handle_toggle_above): new function implements
	the keybinding

	* src/metacity.schemas.in: add toggle_above keybinding

	* src/prefs.[ch]: add toggle_above keybinding

	* src/window.[ch] (meta_window_make_above): new function to put a
	window into the above state
	(meta_window_unmake_above): new function takes a window out of the
	above state
2003-06-27 14:49:56 +00:00