Explorar o código

Merge pull request #99372 from tdaven/fix-inconsistent-wayland-clipboard

Wayland: Only set selection when there is not already a source.
Thaddeus Crews hai 9 meses
pai
achega
778f26e69e
Modificáronse 1 ficheiros con 3 adicións e 3 borrados
  1. 3 3
      platform/linuxbsd/wayland/wayland_thread.cpp

+ 3 - 3
platform/linuxbsd/wayland/wayland_thread.cpp

@@ -3988,10 +3988,10 @@ void WaylandThread::selection_set_text(const String &p_text) {
 		wl_data_source_add_listener(ss->wl_data_source_selection, &wl_data_source_listener, ss);
 		wl_data_source_add_listener(ss->wl_data_source_selection, &wl_data_source_listener, ss);
 		wl_data_source_offer(ss->wl_data_source_selection, "text/plain;charset=utf-8");
 		wl_data_source_offer(ss->wl_data_source_selection, "text/plain;charset=utf-8");
 		wl_data_source_offer(ss->wl_data_source_selection, "text/plain");
 		wl_data_source_offer(ss->wl_data_source_selection, "text/plain");
-	}
 
 
-	// TODO: Implement a good way of getting the latest serial from the user.
-	wl_data_device_set_selection(ss->wl_data_device, ss->wl_data_source_selection, MAX(ss->pointer_data.button_serial, ss->last_key_pressed_serial));
+		// TODO: Implement a good way of getting the latest serial from the user.
+		wl_data_device_set_selection(ss->wl_data_device, ss->wl_data_source_selection, MAX(ss->pointer_data.button_serial, ss->last_key_pressed_serial));
+	}
 
 
 	// Wait for the message to get to the server before continuing, otherwise the
 	// Wait for the message to get to the server before continuing, otherwise the
 	// clipboard update might come with a delay.
 	// clipboard update might come with a delay.