summaryrefslogtreecommitdiff
path: root/src/util.c
Commit message (Collapse)AuthorAgeFilesLines
* A load of fixes of issues reported by sparse. Closes bug #152849Kjartan Maraas2004-09-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2004-09-17 Kjartan Maraas <kmaraas@gnome.org> * src/bell.c: (meta_bell_flash_screen): * src/compositor.c: * src/effects.c: (meta_effects_draw_box_animation): * src/fixedtip.c: (meta_fixed_tip_show): * src/frame.c: (find_argb_visual): * src/frames.c: (unsigned_long_hash), (meta_frames_manage_window), (meta_frames_apply_shapes): * src/iconcache.c: (find_largest_sizes), (find_best_size): * src/keybindings.c: (meta_spawn_command_line_async_on_screen): * src/main.c: (main): * src/menu.c: (meta_window_menu_new): * src/prefs.c: (meta_prefs_get_visual_bell), (meta_prefs_bell_is_audible), (meta_prefs_get_visual_bell_type), (meta_prefs_get_action_double_click_titlebar), (meta_prefs_get_auto_raise), (meta_prefs_get_auto_raise_delay), (meta_prefs_get_reduced_resources): * src/screen.c: (meta_create_offscreen_window): * src/tabpopup.c: (meta_ui_tab_popup_get_selected): * src/theme-parser.c: (meta_theme_load): * src/theme.c: (meta_gtk_widget_get_font_desc): * src/tools/metacity-mag.c: (mouse_press), (begin_area_grab): * src/util.c: (meta_unsigned_long_hash): A load of fixes of issues reported by sparse. Closes bug #152849
* change to track all children of the root window, not only mapped children;Havoc Pennington2003-12-261-0/+2
| | | | | | | | | | | 2003-12-25 Havoc Pennington <hp@redhat.com> * src/compositor.c (meta_compositor_process_event): change to track all children of the root window, not only mapped children; this keeps us from losing track of the stacking order * src/display.c (event_callback): don't do any of the compositor event handling inline, do it all in compositor.c
* redo using new calc_workspace_layout to fix #98302Havoc Pennington2003-01-051-1/+1
| | | | | | | | | | | | | 2003-01-05 Havoc Pennington <hp@pobox.com> * src/workspace.c (meta_workspace_get_neighbor): redo using new calc_workspace_layout to fix #98302 * src/util.c (topic_name): shorten default prefix * src/screen.c (meta_screen_calc_workspace_layout): enhance this to handle all the funky layouts and calculate more information than before
* handle the client having a shape mask, fixes #101806Havoc Pennington2003-01-051-0/+2
| | | | | | | | | | | | | | | | | | | | | 2003-01-05 Havoc Pennington <hp@pobox.com> * src/frames.c (meta_frames_apply_shapes): handle the client having a shape mask, fixes #101806 * src/core.c (meta_core_get_client_xwindow): new function * src/frame.c, src/frame.h: keep a flag for whether we need to update the frame shape * src/window.c (meta_window_new): select for ShapeNotify * src/display.h, src/display.c: actually query the shape extension, instead of just using it all over the place. * src/prefs.c (update_application_based): don't let people turn on application_based, as it just causes funky bugs. We can reenable the pref when/if it ever does something useful.
* add myself here, bug #100789Havoc Pennington2002-12-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-12-09 Havoc Pennington <hp@pobox.com> * AUTHORS: add myself here, bug #100789 * src/display.c (meta_display_set_grab_op_cursor): drop PointerMotionHintMask * src/window.c (meta_window_handle_mouse_grab_op_event): don't use XQueryPointer, as we aren't using PointerMotionHint now * src/display.c (event_callback): rearrange a bit of code for slight speedup and clarity * src/window.c (update_resize) (meta_window_handle_mouse_grab_op_event): implement usage of the _METACITY_UPDATE_COUNTER (meta_window_handle_mouse_grab_op_event): fix code that used event->xbutton with a motion event * src/display.c (meta_display_open): add new atoms, and initialize Xsync if we have it (grab_op_is_resizing): new function (meta_display_begin_grab_op): create an alarm monitoring window's _METACITY_UPDATE_COUNTER (meta_spew_event): conditionalize this on WITH_VERBOSE_MODE and print alarm events. * src/window.c (meta_window_new): fetch _METACITY_UPDATE_COUNTER * configure.in (HAVE_XSYNC): check for Xsync extension
* updatesHavoc Pennington2002-12-091-0/+3
| | | | | | | | | | | | | | 2002-12-08 Havoc Pennington <hp@pobox.com> * README: updates * src/window.c (MAX_RESIZES_PER_SECOND): change to 20 instead of 30, just as an experiment. (MOVE_THRESHOLD): change 15 to 20 (RESIZE_THRESHOLD): change 15 to 20 * src/util.c (ensure_logfile): kill this function when verbose mode is disabled.
* make this always return FALSE for now, to avoid bug reports.Havoc Pennington2002-12-081-6/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-12-08 Havoc Pennington <hp@pobox.com> * src/prefs.c (meta_prefs_get_application_based): make this always return FALSE for now, to avoid bug reports. * src/util.c (ensure_logfile): put "opened log file" message on stderr so it will normally land in ~/.xsession-errors * configure.in: remove extra AC_ARG_PROGRAM * src/display.c (event_callback): handle the toggle-verbose message * src/tools/metacity-message.c: add a toggle-verbose message, been meaning to do this for a while. * src/util.c (meta_set_verbose): if verbose mode is enabled and we don't support it, then exit. * src/prefs.c: allow building without gconf (currently means some prefs are no-ops) * src/util.c, src/util.h: support defining macros to kill all verbose output entirely. (Removes the code and strings associated with it) * configure.in: don't get METACITY_PROPS_LIBS if not building the config dialog. (HAVE_GCONF): allow building sans gconf, if you are size-sensitive and not using gnome. (WITH_VERBOSE_MODE): add ability to disable all the verbose debug spew strings, to shrink the binary. (--disable-sm): allow SM support to be forced on or off (--disable-startup-notification): allow forcing this on or off
* lengthen to 15 secondsHavoc Pennington2002-12-011-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-11-30 Havoc Pennington <hp@pobox.com> * src/screen.c (STARTUP_TIMEOUT): lengthen to 15 seconds * src/util.c (utf8_fputs): hmm, return a value * src/screen.c (meta_screen_apply_startup_properties): new function to apply initial workspace based on startup sequence. * src/window.c (meta_window_new): load _NET_STARTUP_ID (meta_window_get_startup_id): new function * src/window-props.c (meta_display_init_window_prop_hooks): add hooks for _NET_STARTUP_ID * src/display.c (event_callback): send property events to groups. * src/xprops.c (meta_prop_get_values): make a type of INVALID mean to ignore that property (don't fetch its value). * src/group.c (meta_group_property_notify): new function * src/screen.c (set_supported_hint): support _NET_STARTUP_ID * src/display.c (meta_display_open): add _NET_STARTUP_ID to atoms we initialize * src/group-private.h: private header shared between group-props.c, group.c * src/group-props.h, src/group-props.c: new files to contain functions for retrieving group properties * src/window.c (meta_window_same_application): change this a bit to work with new definition of group * src/group.c (meta_window_get_group): always create a group for every window, using the window's own ID as group leader if required. * src/window.c (update_wm_hints): handle changes to group leader * src/group.c (meta_window_group_leader_changed): new function * src/display.h (struct _MetaDisplay): _NET_WM_WINDOW_TYPE_SPLASH, not SPLASHSCREEN. Reported by Gregory Merchan and Matthias Clasen. * src/screen.c (startup_sequence_timeout): when timing out a startup sequence, send a remove message, don't just time it out locally.
* remove XSync calls from here (meta_display_ungrab): remove XSync fromHavoc Pennington2002-11-041-1/+10
| | | | | | | | | | | | | | | | 2002-11-03 Havoc Pennington <hp@pobox.com> * src/display.c (meta_display_grab): remove XSync calls from here (meta_display_ungrab): remove XSync from here, but put in an XFlush to be sure we get the ungrab sent. * src/util.c (meta_topic): track sync count here * src/errors.c: move sync count out of here Throughout: error spew on all XSync() calls * src/run-metacity.sh: don't set METACITY_DEBUG
* new function, and remove workspace->name field, instead just get the nameHavoc Pennington2002-11-031-0/+2
| | | | | | | | | | | | | | | | | | | 2002-11-03 Havoc Pennington <hp@pobox.com> * src/workspace.c (meta_workspace_get_name): new function, and remove workspace->name field, instead just get the name from prefs each time * src/screen.c (meta_screen_update_workspace_names): update the gconf key to persist workspace names here, instead of changing the names we use * src/util.c (topic_name): add META_DEBUG_PREFS * src/prefs.c: change NUM_COMMANDS to 32 to allow more custom commands, implement workspace names * src/metacity.schemas.in: add workspace_names/name_NN gconf keys.
* include config.hHavoc Pennington2002-10-271-5/+5
| | | | | | | | | | | | | | | | | 2002-10-26 Havoc Pennington <hp@pobox.com> * src/iconcache.c: include config.h * src/group.c: include config.h * src/frame.c: include config.h * src/core.c: include config.h so it doesn't crash all over the place due to #ifdef HAVE_STARTUP_NOTIFICATION * src/util.c (meta_print_backtrace): export from this file * src/main.c (log_handler): print backtrace here
* Add "busy cursor on app startup" support, conditionally - works only ifHavoc Pennington2002-10-251-0/+2
| | | | | | | | | | | | | | | | 2002-10-25 Havoc Pennington <hp@pobox.com> Add "busy cursor on app startup" support, conditionally - works only if libstartup-notification is found, and in practice requires a GTK patch that's not in yet. * src/screen.c: monitor startup events and set busy cursor if appropriate * src/display.c (meta_display_open): create SnDisplay * configure.in: check for startup notification, and add the cute "configure summary" at the end
* Optimizations for managing new windows (do not all take effect ifHavoc Pennington2002-10-211-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-10-21 Havoc Pennington <hp@redhat.com> Optimizations for managing new windows (do not all take effect if METACITY_DEBUG=1). Bug #96404 * src/keybindings.c (meta_change_keygrab): use error trap nesting and conditionalize on meta_is_verbose() to avoid a ton of XSync * src/display.c (meta_change_button_grab): ditto Throughout: move to new error trap setup to save on XSync calls, new setup is: * src/errors.c (meta_error_trap_push_with_return): new function, an error trap that needs to care about return value and thus sync even if an outer trap still exists (meta_error_trap_pop_with_return): new function (meta_error_trap_pop): add "last_request_was_roundtrip" argument allowing us to avoid XSync() if we just did a GetProperty or whatever. * src/util.c (meta_warning): flush the warning file descriptor * src/Makefile.am (INCLUDES): define G_LOG_DOMAIN
* translate some strings that should have been, and convert to localeHavoc Pennington2002-08-241-11/+27
| | | | | | | | | | | | | 2002-08-24 Havoc Pennington <hp@redhat.com> * src/util.c: translate some strings that should have been, and convert to locale encoding before printing stuff. * src/stack.c (group_member_is_fullscreen): if window itself is fullscreen, return TRUE immediately. * src/window.c (meta_window_configure_request): add hack to fullscreenize large undecorated windows.
* window is in fullscreen layer if any member of its group is fullscreenHavoc Pennington2002-08-121-0/+20
| | | | | | | | | | | | | | | | 2002-08-12 Havoc Pennington <hp@redhat.com> * src/stack.c (compute_layer): window is in fullscreen layer if any member of its group is fullscreen * src/window.c (meta_window_unmake_fullscreen): update layer for whole window group (meta_window_make_fullscreen): ditto * src/util.c (meta_unsigned_long_hash): move hash/equal funcs for Window in here. * src/group.c: track window groups so we can do stuff with them.
* handle NULL screen from screen_for_xwindowHavoc Pennington2002-07-231-0/+33
| | | | | | | | | | | | | | 2002-07-23 Havoc Pennington <hp@redhat.com> * src/keybindings.c (meta_display_process_key_event): handle NULL screen from screen_for_xwindow * src/display.c (meta_display_screen_for_xwindow): put an error trap around the XGetWindowAttributes(), should fix the popular "closing a window results in a crash" bug. * src/util.c (print_backtrace): support optional backtrace feature using gnu libc backtrace() call
* don't die on bad atom nameHavoc Pennington2002-06-081-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | 2002-06-08 Havoc Pennington <hp@pobox.com> * src/xprops.c (meta_prop_get_utf8_string): don't die on bad atom name * src/display.c (meta_display_close): don't unmanage windows here, do it in screen_free and then closing the display unmanages windows as a side effect of unmanaging the screen (meta_display_unmanage_screen): new function (process_selection_clear, process_selection_request): handle selection stuff (meta_spew_event): don't crash on client message containing invalid atom (meta_spew_event): don't crash on property notify with invalid atom * src/main.c (main): add --replace option to replace existing window manager. * src/screen.c: implement holding manager selection. * src/display.c (meta_display_open): add new selection-related atoms.
* remove caveats about keybindingsHavoc Pennington2002-04-281-0/+2
| | | | | | | | | | | | | | | | | | | | | | | 2002-04-28 Havoc Pennington <hp@pobox.com> * README: remove caveats about keybindings * src/metacity.schemas: add schemas for all the keybindings. * src/window.c (meta_window_activate): if in "show desktop" mode when a window is activated, leave show desktop mode. So e.g. when you click on a task in the task list, show desktop mode will be turned off. * src/workspace.c (meta_workspace_get_neighbor): new function that doesn't quite work yet (needs support for getting workspace layout from the pager) * src/prefs.c: keybindings stuff * src/keybindings.c: make keybindings configurable * src/ui.c (meta_ui_parse_accelerator): new function
* query Xinerama screen information if HAVE_XINERAMAHavoc Pennington2002-04-211-0/+2
| | | | | | | | | 2002-04-17 Havoc Pennington <hp@pobox.com> * src/screen.c (meta_screen_new): query Xinerama screen information if HAVE_XINERAMA * configure.in (found_xinerama): check for Xinerama
* use hash_table_replace instead of g_hash_table_insertHavoc Pennington2002-03-061-1/+1
| | | | | | | | | | | | | | | | | | | 2002-03-06 Havoc Pennington <hp@redhat.com> * src/frames.c (meta_frames_manage_window): use hash_table_replace instead of g_hash_table_insert * src/main.c (main): only enable verbose/debug if you set METACITY_VERBOSE/METACITY_DEBUG * src/util.c (ensure_logfile): only use a log file if METACITY_USE_LOGFILE is set * src/display.c (meta_display_for_x_display): add warning if MetaDisplay isn't found * src/window.c (meta_window_free): add an assertion that we successfully cleared the grab window
* try ignoring SIGXFSZ, though I'm not sure what that does exactly. I'mHavoc Pennington2002-03-051-11/+34
| | | | | | | | | | 2002-03-04 Havoc Pennington <hp@pobox.com> * src/main.c (main): try ignoring SIGXFSZ, though I'm not sure what that does exactly. I'm hoping it gives me EFBIG. * src/util.c (ensure_logfile): log to a file in /tmp instead of to ~/metacity.log.
* Add hacking to fix the problem that we made our XGrabPointer() duringHavoc Pennington2002-03-021-1/+2
| | | | | | | | | | 2002-03-02 Havoc Pennington <hp@pobox.com> * src/display.c: Add hacking to fix the problem that we made our XGrabPointer() during Alt+Tab actually succeed, so on popping down Alt+Tab we got an EnterNotify from the ungrab, which resulted in focusing the window under the mouse. i.e. Alt+Tab didn't work with sloppy focus.
* Throughout: move to meta_topic rather than meta_verbose so metacity.logHavoc Pennington2002-02-081-3/+18
| | | | | | | | | | | 2002-02-07 Havoc Pennington <hp@pobox.com> Throughout: move to meta_topic rather than meta_verbose so metacity.log can start being more useful * src/util.h (enum): add more debug topics * src/frames.c: clean up some cruft that caused warnings
* move in here so util.c doesn't require display.[hc]Havoc Pennington2002-01-281-27/+7
| | | | | | | | | | | | | | | 2002-01-27 Havoc Pennington <hp@pobox.com> * src/display.c (meta_set_syncing): move in here so util.c doesn't require display.[hc] * src/theme.h, src/theme.c: implement coordinate expression parser, write MetaShapeSpec declaration * src/util.c (meta_exit): move in here so we can link to util.c with a different main() * src/theme.h: rename the MetaWindow* enums to MetaFrame*
* draw titlebar highlight with snazzy gradient that needs some tweaking toHavoc Pennington2002-01-061-0/+3
| | | | | | | | | | | 2002-01-05 Havoc Pennington <hp@pobox.com> * src/frames.c (meta_frames_expose_event): draw titlebar highlight with snazzy gradient that needs some tweaking to be less dumb-looking * src/theme.c: replace old theme.[hc] contents with newer stuff that doesn't do anything
* use meta_XFree not XFreeHavoc Pennington2002-01-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 2002-01-03 Havoc Pennington <hp@pobox.com> * src/window.c: use meta_XFree not XFree * src/display.h (meta_XFree): add null-safe XFree * src/util.c (meta_warning): have message prefix indicate that it's a warning (meta_fatal): indicate it's an error * src/window.c (update_sm_hints): clean up using meta_prop_get_latin1_string (update_role): ditto (read_client_leader): clean up using meta_prop_get_window (update_net_wm_type): clean up using meta_prop_get_cardinal (update_initial_workspace): ditto (update_net_wm_type): clean up using meta_prop_get_atom_list (read_rgb_icon): get result from XGetWindowProperty return value not from error trap (update_kwm_icon): ditto (meta_window_new): fix to read WM_STATE correctly
* focus top window when switching to a new workspaceHavoc Pennington2002-01-031-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 2002-01-03 Havoc Pennington <hp@pobox.com> * src/workspace.c (meta_workspace_activate): focus top window when switching to a new workspace * src/util.c (meta_topic): start putting verbose output in categories * src/window.c (meta_window_shade): focus frame after we queue the calc_showing so the maps/unmaps have already happened. * src/display.c (meta_display_get_current_time): add the "get time of current event" function and call it occasionally. * src/window.c (meta_window_free): if we have focus, call meta_screen_focus_top_window(). (meta_window_minimize): ditto (meta_window_delete): ditto * src/screen.c (meta_screen_ensure_tab_popup): fix memory leak - didn't free tab list (meta_screen_focus_top_window): new function to use when we unmap or unmanage a focused window * src/stack.c (meta_stack_get_default_focus_window): function used in meta_screen_focus_top_window
* icon for unmaximizeHavoc Pennington2001-09-111-0/+1
| | | | | | | | | | | | 2001-09-10 Havoc Pennington <hp@pobox.com> * src/menu.c (meta_window_menu_new): icon for unmaximize * src/ui.c (meta_ui_init): fix call to XDisplayName * src/util.c: add missing header * src/frames.c: draw an unmaximize control if already maximized
* Don't separate user_has_moved/user_has_resized, fixes bug in east-resizingHavoc Pennington2001-09-111-0/+3
| | | | | | | | | | | | | 2001-09-10 Havoc Pennington <hp@pobox.com> * src/window.c: Don't separate user_has_moved/user_has_resized, fixes bug in east-resizing Emacs, among other things * src/frame.c (meta_frame_sync_to_window): return immediately if nothing to do * src/util.c (ensure_logfile): replace rather than truncate old logfiles
* ...rhp2001-06-211-0/+8
|
* ...rhp2001-06-111-14/+57
|
* ...rhp2001-06-101-5/+25
|
* ...rhp2001-05-311-2/+43
|
* ...rhp2001-05-311-0/+22
|
* ...rhp2001-05-301-0/+119