### Godot version

4.0dev (4fa6edc88)

### System information

Ubuntu 20.04.2 LTS

### Issue description

Panning of the 2D view does not work after attempting to rename node

### Steps to reproduce

1. Open the a scene in the 2D viewing tab
2. Double click to rename any node under the scene tab
3. click into the 2D view directly
4. attempt to pan the view through middle-clicking or using the pan tool

Refocusing the editor window will fix it temporarily

### Minimal reproduction project

[Panning Issue.zip](https://github.com/godotengine/godot/files/10529131/Panning.Issue.zip)

all_event_mask.mask_len = sizeof(all_mask_data);
			all_event_mask.mask = all_mask_data;
			XISetMask(all_event_mask.mask, XI_HierarchyChanged);
#ifdef TOUCH_ENABLED
			if (xi.touch_devices.size()) {
				XISetMask(all_event_mask.mask, XI_TouchBegin);
				XISetMask(all_event_mask.mask, XI_TouchUpdate);
				XISetMask(all_event_mask.mask, XI_TouchEnd);
				XISetMask(all_event_mask.mask, XI_TouchOwnership);
			}
#endif
			XISelectEvents(x11_display, wd.x11_window, &all_event_mask, 1);
		}
		
		XStoreName(x11_display, wd.x11_window, "Godot");
		XSetWMProtocols(x11_display, wd.x11_window, &wm_delete, 1);
		if (xdnd_aware != None) {
			XChangeProperty(x11_display, wd.x11_window, xdnd_aware, XA_ATOM, 32, PropModeReplace, (unsigned char *)&xdnd_version, 1);
		}
		if (xim && xim_style) {
			
			
			MutexLock mutex_lock(events_mutex);
			
			if ((xim_style & XIMPreeditPosition) != 0) {
				xim_style &= ~XIMPreeditPosition;
				xim_style |= XIMPreeditCallbacks;
			}
			if ((xim_style & XIMPreeditCallbacks) != 0) {
				::XIMCallback preedit_start_callback;