Skip to content

Commit

Permalink
Remove 'is_pointer_on_this_screen'
Browse files Browse the repository at this point in the history
The tracking bit-field for determining where the pointer is on different
screens is no longer used.

Fixes #333
  • Loading branch information
ThomasAdam committed Jan 22, 2021
1 parent 6bfc581 commit fdee02c
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 56 deletions.
26 changes: 1 addition & 25 deletions fvwm/events.c
Original file line number Diff line number Diff line change
Expand Up @@ -2143,26 +2143,7 @@ ENTER_DBG((stderr, "en: exit: found LeaveNotify\n"));
{
FvwmWindow *lf = get_last_screen_focus_window();

if (!Scr.flags.is_pointer_on_this_screen)
{
Scr.flags.is_pointer_on_this_screen = 1;
if (lf && lf != &Scr.FvwmRoot &&
!FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(lf)))
{
SetFocusWindow(lf, True, FOCUS_SET_FORCE);
}
else if (lf != &Scr.FvwmRoot)
{
ForceDeleteFocus();
}
else
{
/* This was the first EnterNotify event for the
* root window - ignore */
}
set_last_screen_focus_window(NULL);
}
else if (!(sf = get_focus_window()) ||
if (!(sf = get_focus_window()) ||
FP_DO_UNFOCUS_LEAVE(FW_FOCUS_POLICY(sf)))
{
DeleteFocus(True);
Expand All @@ -2180,10 +2161,6 @@ ENTER_DBG((stderr, "en: exit: found LeaveNotify\n"));
focus_grab_buttons(lf);
return;
}
else
{
Scr.flags.is_pointer_on_this_screen = 1;
}

/* An EnterEvent in one of the PanFrameWindows activates the Paging or
an EdgeCommand. */
Expand Down Expand Up @@ -2238,7 +2215,6 @@ ENTER_DBG((stderr, "en: exit: found LeaveNotify\n"));
m = fw->m;

/* this was in the HandleMotionNotify before, HEDU */
Scr.flags.is_pointer_on_this_screen = 1;
e = *te;
int p = HandlePaging(
&e, m->virtual_scr.EdgeScrollX,
Expand Down
25 changes: 0 additions & 25 deletions fvwm/focus.c
Original file line number Diff line number Diff line change
Expand Up @@ -253,27 +253,6 @@ static void __update_windowlist(
return;
}

static Bool __try_other_screen_focus(const FvwmWindow *fw)
{
if (fw == NULL && !Scr.flags.is_pointer_on_this_screen)
{
FvwmWindow *sf;

sf = get_focus_window();
set_focus_window(NULL);
if (sf != NULL)
{
focus_grab_buttons(sf);
}
/* DV (25-Nov-2000): Don't give the Scr.NoFocusWin the focus
* here. This would steal the focus from the other screen's
* root window again. */
return True;
}

return False;
}

/*
* Sets the input focus to the indicated window.
*/
Expand All @@ -293,10 +272,6 @@ static void __set_focus_to_fwin(
return;
}
__update_windowlist(fw, args->set_by, args->is_focus_by_flip_focus_cmd);
if (__try_other_screen_focus(fw) == True)
{
return;
}

if (fw && !args->do_forbid_warp)
{
Expand Down
4 changes: 0 additions & 4 deletions fvwm/fvwm3.c
Original file line number Diff line number Diff line change
Expand Up @@ -1207,10 +1207,6 @@ static void InitVariables(void)
/* Not the right place for this, should only be called once
* somewhere .. */

Scr.flags.is_pointer_on_this_screen = !!FQueryPointer(
dpy, Scr.Root, &JunkRoot, &JunkChild, &JunkX, &JunkY, &JunkX,
&JunkY, &JunkMask);

/* make sure colorset 0 exists */
alloc_colorset(0);

Expand Down
2 changes: 0 additions & 2 deletions fvwm/screen.h
Original file line number Diff line number Diff line change
Expand Up @@ -460,8 +460,6 @@ typedef struct ScreenInfo
unsigned is_executing_complex_function : 1;
unsigned is_executing_menu_function : 1;
unsigned is_map_desk_in_progress : 1;
unsigned is_pointer_on_this_screen : 1;
unsigned is_single_screen : 1;
unsigned is_window_scheduled_for_destroy : 1;
unsigned is_wire_frame_displayed : 1;
} flags;
Expand Down

0 comments on commit fdee02c

Please sign in to comment.