~ubuntu-dev/ubuntu/lucid/mutter/lucid-201002110959

« back to all changes in this revision

Viewing changes to src/core/display.c

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2009-09-05 16:23:00 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20090905162300-uh014j826cs7xe76
Tags: 2.27.4-0ubuntu1
* New upstream release
* add debian/watch

Show diffs side-by-side

added added

removed removed

Lines of Context:
483
483
  the_display->leader_window = None;
484
484
  the_display->timestamp_pinging_window = None;
485
485
 
486
 
  the_display->xinerama_cache_invalidated = TRUE;
 
486
  the_display->monitor_cache_invalidated = TRUE;
487
487
 
488
488
  the_display->groups_by_leader = NULL;
489
489
 
722
722
                                    the_display->leader_window,
723
723
                                    the_display->atom__NET_WM_NAME,
724
724
                                    "Mutter");
 
725
 
 
726
    /* The GNOME keybindings capplet should include both the Mutter and Metacity
 
727
     * keybindings */
 
728
    meta_prop_set_utf8_string_hint (the_display,
 
729
                                    the_display->leader_window,
 
730
                                    the_display->atom__GNOME_WM_KEYBINDINGS,
 
731
                                    "Mutter,Metacity");
725
732
    
726
733
    meta_prop_set_utf8_string_hint (the_display,
727
734
                                    the_display->leader_window,
1007
1014
    meta_compositor_destroy (display->compositor);
1008
1015
  
1009
1016
  g_object_unref (display);
 
1017
  the_display = NULL;
1010
1018
 
1011
1019
  meta_quit (META_EXIT_SUCCESS);
1012
1020
}
1198
1206
    case META_GRAB_OP_KEYBOARD_RESIZING_SW:
1199
1207
    case META_GRAB_OP_KEYBOARD_RESIZING_NW:
1200
1208
    case META_GRAB_OP_KEYBOARD_MOVING:
 
1209
    case META_GRAB_OP_COMPOSITOR:
1201
1210
      return TRUE;
1202
1211
 
1203
1212
    default:
1227
1236
    case META_GRAB_OP_KEYBOARD_ESCAPING_DOCK:
1228
1237
    case META_GRAB_OP_KEYBOARD_ESCAPING_GROUP:
1229
1238
    case META_GRAB_OP_KEYBOARD_WORKSPACE_SWITCHING:
 
1239
    case META_GRAB_OP_COMPOSITOR:
1230
1240
      return TRUE;
1231
1241
 
1232
1242
    default:
1508
1518
  MetaDisplay *display;
1509
1519
  Window modified;
1510
1520
  gboolean frame_was_receiver;
 
1521
  gboolean bypass_compositor;
1511
1522
  gboolean filter_out_event;
1512
1523
 
1513
1524
  display = data;
1521
1532
  sn_display_process_event (display->sn_display, event);
1522
1533
#endif
1523
1534
  
 
1535
  bypass_compositor = FALSE;
1524
1536
  filter_out_event = FALSE;
1525
1537
  display->current_time = event_get_time (display, event);
1526
 
  display->xinerama_cache_invalidated = TRUE;
 
1538
  display->monitor_cache_invalidated = TRUE;
1527
1539
  
1528
1540
  modified = event_get_modified_window (display, event);
1529
1541
  
1667
1679
    {
1668
1680
    case KeyPress:
1669
1681
    case KeyRelease:
1670
 
      meta_display_process_key_event (display, window, event);
 
1682
      if (display->grab_op == META_GRAB_OP_COMPOSITOR)
 
1683
        break;
 
1684
 
 
1685
      /* For key events, it's important to enforce single-handling, or
 
1686
       * we can get into a confused state. So if a keybinding is
 
1687
       * handled (because it's one of our hot-keys, or because we are
 
1688
       * in a keyboard-grabbed mode like moving a window, we don't
 
1689
       * want to pass the key event to the compositor at all.
 
1690
       */
 
1691
      bypass_compositor = meta_display_process_key_event (display, window, event);
1671
1692
      break;
1672
1693
    case ButtonPress:
 
1694
      if (display->grab_op == META_GRAB_OP_COMPOSITOR)
 
1695
        break;
 
1696
 
1673
1697
      if (event->xbutton.button == 4 || event->xbutton.button == 5)
1674
 
        {
1675
 
          /* Scrollwheel event, do nothing and deliver event to compositor below
1676
 
           */
1677
 
        }
1678
 
      else if ((window &&
 
1698
        /* Scrollwheel event, do nothing and deliver event to compositor below */
 
1699
        break;
 
1700
 
 
1701
      if ((window &&
1679
1702
           grab_op_is_mouse (display->grab_op) &&
1680
1703
           display->grab_button != (int) event->xbutton.button &&
1681
1704
           display->grab_window == window) ||
1865
1888
        }
1866
1889
      break;
1867
1890
    case ButtonRelease:
 
1891
      if (display->grab_op == META_GRAB_OP_COMPOSITOR)
 
1892
        break;
 
1893
 
1868
1894
      if (display->grab_window == window &&
1869
1895
          grab_op_is_mouse (display->grab_op))
1870
1896
        meta_window_handle_mouse_grab_op_event (window, event);
1871
1897
      break;
1872
1898
    case MotionNotify:
 
1899
      if (display->grab_op == META_GRAB_OP_COMPOSITOR)
 
1900
        break;
 
1901
 
1873
1902
      if (display->grab_window == window &&
1874
1903
          grab_op_is_mouse (display->grab_op))
1875
1904
        meta_window_handle_mouse_grab_op_event (window, event);
1876
1905
      break;
1877
1906
    case EnterNotify:
 
1907
      if (display->grab_op == META_GRAB_OP_COMPOSITOR)
 
1908
        break;
 
1909
 
1878
1910
      if (display->grab_window == window &&
1879
1911
          grab_op_is_mouse (display->grab_op))
1880
1912
        {
1967
1999
        }
1968
2000
      break;
1969
2001
    case LeaveNotify:
 
2002
      if (display->grab_op == META_GRAB_OP_COMPOSITOR)
 
2003
        break;
 
2004
 
1970
2005
      if (display->grab_window == window &&
1971
2006
          grab_op_is_mouse (display->grab_op))
1972
2007
        meta_window_handle_mouse_grab_op_event (window, event);
2533
2568
      break;
2534
2569
    }
2535
2570
 
2536
 
  if (display->compositor)
 
2571
  if (display->compositor && !bypass_compositor)
2537
2572
    {
2538
2573
      if (meta_compositor_process_event (display->compositor,
2539
2574
                                         event,
3175
3210
  remove_pending_pings_for_window (display, xwindow);
3176
3211
}
3177
3212
 
 
3213
/**
 
3214
 * meta_display_xwindow_is_a_no_focus_window:
 
3215
 * @display: A #MetaDisplay
 
3216
 * @xwindow: An X11 window
 
3217
 *
 
3218
 * Returns %TRUE iff window is one of mutter's internal "no focus" windows
 
3219
 * (there is one per screen) which will have the focus when there is no
 
3220
 * actual client window focused.
 
3221
 */
3178
3222
gboolean
3179
3223
meta_display_xwindow_is_a_no_focus_window (MetaDisplay *display,
3180
3224
                                           Window xwindow)
3688
3732
    }
3689
3733
}
3690
3734
 
 
3735
/**
 
3736
 * meta_display_get_grab_op:
 
3737
 * Gets the current grab operation, if any.
 
3738
 *
 
3739
 * Return value: the current grab operation, or %META_GRAB_OP_NONE if
 
3740
 * Mutter doesn't currently have a grab. %META_GRAB_OP_COMPOSITOR will
 
3741
 * be returned if a compositor-plugin modal operation is in effect
 
3742
 * (See mutter_begin_modal_for_plugin())
 
3743
 */
 
3744
MetaGrabOp
 
3745
meta_display_get_grab_op (MetaDisplay *display)
 
3746
{
 
3747
  return display->grab_op;
 
3748
}
 
3749
 
3691
3750
void
3692
3751
meta_display_check_threshold_reached (MetaDisplay *display,
3693
3752
                                      int          x,
4529
4588
  else
4530
4589
    {
4531
4590
      skip = display->focus_window != NULL && 
4532
 
             IN_TAB_CHAIN (display->focus_window, type);
 
4591
             tab_list->data == display->focus_window;
4533
4592
      if (backward)
4534
4593
        ret = find_tab_backward (display, type, screen, workspace,
4535
4594
                                 tab_list, skip);
5059
5118
              meta_warning ("%s appears to be one of the offending windows "
5060
5119
                            "with a timestamp of %u.  Working around...\n",
5061
5120
                            window->desc, window->net_wm_user_time);
5062
 
              window->net_wm_user_time = timestamp;
 
5121
              meta_window_set_user_time (window, timestamp);
5063
5122
            }
5064
 
          
 
5123
 
5065
5124
          tmp = tmp->next;
5066
5125
        }
5067
5126