Problems when switching from windowed mode to fullscreen.

I’m having problems when switching from WindowMode::windowed to WindowMode::fullscreen. I have had some problems also when just changing resolution when in Fullscreen mode. The problems are a few different problems:

  1. The game window sizes down to a about the quarter of the fullscreen size and sits in the left top hand cornor. (Have not got this in a while now, but im still listing it.)

  2. The game window disappears fully and cannot be brought to top of the screen. This is the main issue now, and happens when switching back and forth between windowed mode and fullscreen mode, when switching to fullscreen mode.

  3. The game window disappears and can be brought up again.

I have also noticed that the antivirus system triggers a popup telling me it wants my attention, but doesnt provide any more info (could it be that fullscreen somehow is seen as a prohibited action from the antivirus prorgram?).
Do you guys have any experience on this? I will do some more tests to see if its specific resolutions that causes this issue or if i can focus down the issue to some action. But right now it seems to be the fullscreen option that is key here.

Worth notice is that I’m running on a 4k TV.

Can this be the issue?
I have come to understand that it is standard to let people choose fullscreen and still be able to switch resolution. But maybe this is not the case? Do we still support real Fullscreen or would it be fine with Windowed Fullscreen where I’m not having these problems?

I run this code when changing resolution:

void UZoneGameUserSettings::ApplyResolutionChanges()
{
	UGameUserSettings* gameUserSettings = GEngine->GetGameUserSettings();
	if (gameUserSettings)
	{
		gameUserSettings->SetScreenResolution(FIntPoint(ResolutionsX, ResolutionsY));
		gameUserSettings->ApplyResolutionSettings(false);
	}
}

And this to change fullscreen mode:

void UZoneGameUserSettings::ApplyFullscreenModeChanges()
{
	UGameUserSettings* gameUserSettings = GEngine->GetGameUserSettings();
	if (gameUserSettings)
	{
		gameUserSettings->SetFullscreenMode(WindowMode);
		gameUserSettings->ApplyResolutionSettings(false);
	}
}

This is the variables im using in the header:

	UPROPERTY(BlueprintReadWrite, EditAnywhere, Config) TEnumAsByte<EWindowMode::Type> WindowMode = EWindowMode::Fullscreen;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Config) int32 ResolutionsX = 1920;
	UPROPERTY(BlueprintReadWrite, EditAnywhere, Config) int32 ResolutionsY = 1080;

I also tried to change window mode and resolution with command line instead, which is resulting in similar behaviour:

void UZoneGameUserSettings::ApplyResolutionChangesWithCommandline()
{
	FString command = "r.SetRes ";
	FString resolutionStr = GetResolutionString();
	FString FullScreenMode = "";

	switch (WindowMode)
	{
	case EWindowMode::Fullscreen:
		FullScreenMode = "f";
		break;
	case EWindowMode::Windowed:
		FullScreenMode = "w";
		break;
	case EWindowMode::WindowedFullscreen:
		FullScreenMode = "wf";
		break;
	default:
		break;
	}

	FString totalString = command + resolutionStr + FullScreenMode;

	GEngine->Exec(GetWorld(), *totalString);
}