MetaDisplay: Renamed 'ignored_serials' for clarity
The ignored_serials member of Display refers explicitly to crossing serials - rename the member and associated functions and constants for clarity. https://bugzilla.gnome.org/show_bug.cgi?id=597190
This commit is contained in:
parent
1ab6abc044
commit
e1362562b4
@ -77,7 +77,7 @@ typedef enum {
|
|||||||
* also has to be big enough to hold ignored serials from the point
|
* also has to be big enough to hold ignored serials from the point
|
||||||
* where we reshape the stage to the point where we get events back.
|
* where we reshape the stage to the point where we get events back.
|
||||||
*/
|
*/
|
||||||
#define N_IGNORED_SERIALS 10
|
#define N_IGNORED_CROSSING_SERIALS 10
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
META_TILE_NONE,
|
META_TILE_NONE,
|
||||||
@ -155,7 +155,7 @@ struct _MetaDisplay
|
|||||||
* correspond to an enter event we should
|
* correspond to an enter event we should
|
||||||
* ignore
|
* ignore
|
||||||
*/
|
*/
|
||||||
unsigned long ignored_serials[N_IGNORED_SERIALS];
|
unsigned long ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS];
|
||||||
Window ungrab_should_not_cause_focus_window;
|
Window ungrab_should_not_cause_focus_window;
|
||||||
|
|
||||||
guint32 current_time;
|
guint32 current_time;
|
||||||
|
@ -532,9 +532,9 @@ meta_display_open (void)
|
|||||||
meta_unsigned_long_equal);
|
meta_unsigned_long_equal);
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < N_IGNORED_SERIALS)
|
while (i < N_IGNORED_CROSSING_SERIALS)
|
||||||
{
|
{
|
||||||
the_display->ignored_serials[i] = 0;
|
the_display->ignored_crossing_serials[i] = 0;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
the_display->ungrab_should_not_cause_focus_window = None;
|
the_display->ungrab_should_not_cause_focus_window = None;
|
||||||
@ -1401,30 +1401,30 @@ meta_display_add_ignored_crossing_serial (MetaDisplay *display,
|
|||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* don't add the same serial more than once */
|
/* don't add the same serial more than once */
|
||||||
if (display->ignored_serials[N_IGNORED_SERIALS-1] == serial)
|
if (display->ignored_crossing_serials[N_IGNORED_CROSSING_SERIALS-1] == serial)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
/* shift serials to the left */
|
/* shift serials to the left */
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < (N_IGNORED_SERIALS - 1))
|
while (i < (N_IGNORED_CROSSING_SERIALS - 1))
|
||||||
{
|
{
|
||||||
display->ignored_serials[i] = display->ignored_serials[i+1];
|
display->ignored_crossing_serials[i] = display->ignored_crossing_serials[i+1];
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
/* put new one on the end */
|
/* put new one on the end */
|
||||||
display->ignored_serials[i] = serial;
|
display->ignored_crossing_serials[i] = serial;
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
serial_is_ignored (MetaDisplay *display,
|
crossing_serial_is_ignored (MetaDisplay *display,
|
||||||
unsigned long serial)
|
unsigned long serial)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < N_IGNORED_SERIALS)
|
while (i < N_IGNORED_CROSSING_SERIALS)
|
||||||
{
|
{
|
||||||
if (display->ignored_serials[i] == serial)
|
if (display->ignored_crossing_serials[i] == serial)
|
||||||
return TRUE;
|
return TRUE;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
@ -1432,14 +1432,14 @@ serial_is_ignored (MetaDisplay *display,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
reset_ignores (MetaDisplay *display)
|
reset_ignored_crossing_serials (MetaDisplay *display)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
i = 0;
|
i = 0;
|
||||||
while (i < N_IGNORED_SERIALS)
|
while (i < N_IGNORED_CROSSING_SERIALS)
|
||||||
{
|
{
|
||||||
display->ignored_serials[i] = 0;
|
display->ignored_crossing_serials[i] = 0;
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2000,7 +2000,7 @@ event_callback (XEvent *event,
|
|||||||
/* Check if we've entered a window; do this even if window->has_focus to
|
/* Check if we've entered a window; do this even if window->has_focus to
|
||||||
* avoid races.
|
* avoid races.
|
||||||
*/
|
*/
|
||||||
if (window && !serial_is_ignored (display, event->xany.serial) &&
|
if (window && !crossing_serial_is_ignored (display, event->xany.serial) &&
|
||||||
event->xcrossing.mode != NotifyGrab &&
|
event->xcrossing.mode != NotifyGrab &&
|
||||||
event->xcrossing.mode != NotifyUngrab &&
|
event->xcrossing.mode != NotifyUngrab &&
|
||||||
event->xcrossing.detail != NotifyInferior &&
|
event->xcrossing.detail != NotifyInferior &&
|
||||||
@ -2025,7 +2025,7 @@ event_callback (XEvent *event,
|
|||||||
meta_window_focus (window, event->xcrossing.time);
|
meta_window_focus (window, event->xcrossing.time);
|
||||||
|
|
||||||
/* stop ignoring stuff */
|
/* stop ignoring stuff */
|
||||||
reset_ignores (display);
|
reset_ignored_crossing_serials (display);
|
||||||
|
|
||||||
if (meta_prefs_get_auto_raise ())
|
if (meta_prefs_get_auto_raise ())
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user