Pārlūkot izejas kodu

libobs: Ignore OSX keyboard layout notifications w/o layout change

These notifications can happen with e.g. the Japanese Kotoeri layout
when switching between active windows
Palana 10 gadi atpakaļ
vecāks
revīzija
0037d7c011
1 mainītis faili ar 8 papildinājumiem un 0 dzēšanām
  1. 8 0
      libobs/obs-cocoa.c

+ 8 - 0
libobs/obs-cocoa.c

@@ -1208,6 +1208,14 @@ static void input_method_changed(CFNotificationCenterRef nc, void *observer,
 
 
 		pthread_mutex_lock(&hotkeys->mutex);
 		pthread_mutex_lock(&hotkeys->mutex);
 		plat = hotkeys->platform_context;
 		plat = hotkeys->platform_context;
+
+		if (new_plat && plat &&
+				new_plat->layout_data == plat->layout_data) {
+			pthread_mutex_unlock(&hotkeys->mutex);
+			hotkeys_release(new_plat);
+			return;
+		}
+
 		hotkeys->platform_context = new_plat;
 		hotkeys->platform_context = new_plat;
 		if (new_plat)
 		if (new_plat)
 			log_layout_name(new_plat->tis);
 			log_layout_name(new_plat->tis);