/** * bell_flash_frame: * @display: The display the bell event came in on * @xkb_ev: The bell event we just received * * Flashes the frame of the focused window. If there is no focused window, * flashes the screen. */ static void bell_flash_frame (MetaDisplay *display, MetaWindow *window) { if (window && window->frame) bell_flash_window_frame (window); else bell_flash_fullscreen (display); }
/** * bell_visual_notify: * @display: The display the bell event came in on * @xkb_ev: The bell event we just received * * Gives the user some kind of visual bell substitute, in response to a * bell event. What this is depends on the "visual bell type" pref. */ static void bell_visual_notify (MetaDisplay *display, MetaWindow *window) { switch (meta_prefs_get_visual_bell_type ()) { case G_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH: bell_flash_fullscreen (display); break; case G_DESKTOP_VISUAL_BELL_FRAME_FLASH: bell_flash_frame (display, window); break; } }
/* * Gives the user some kind of visual bell substitute, in response to a * bell event. What this is depends on the "visual bell type" pref. * * If the configure script found we had no XKB, this does not exist. * * \param display The display the bell event came in on * \param xkb_ev The bell event we just received * * \bug This should be merged with meta_bell_notify(). */ static void bell_visual_notify (MetaDisplay *display, XkbAnyEvent *xkb_ev) { switch (meta_prefs_get_visual_bell_type ()) { case C_DESKTOP_VISUAL_BELL_FULLSCREEN_FLASH: bell_flash_fullscreen (display, xkb_ev); break; case C_DESKTOP_VISUAL_BELL_FRAME_FLASH: bell_flash_frame (display, xkb_ev); /* does nothing yet */ break; } }
/** * Flashes the frame of the focussed window. If there is no focussed window, * flashes the screen. * * \param display The display the bell event came in on * \param xkb_ev The bell event we just received */ static void bell_flash_frame (MetaDisplay *display, XkbAnyEvent *xkb_ev) { XkbBellNotifyEvent *xkb_bell_event = (XkbBellNotifyEvent *) xkb_ev; MetaWindow *window; g_assert (xkb_ev->xkb_type == XkbBellNotify); window = meta_display_lookup_x_window (display, xkb_bell_event->window); if (!window && (display->focus_window)) { window = display->focus_window; } if (window && window->frame) { bell_flash_window_frame (window); } else /* revert to fullscreen flash if there's no focussed window */ { bell_flash_fullscreen (display, xkb_ev); } }