Skip to content

Commit

Permalink
Miscellaneous pending fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 30, 2020
1 parent 598cf69 commit c9c8978
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 14 deletions.
Expand Up @@ -166,13 +166,13 @@ public HIDDeviceBLESteamController(HIDDeviceManager manager, BluetoothDevice dev
mHandler = new Handler(Looper.getMainLooper());

mGatt = connectGatt();
final HIDDeviceBLESteamController finalThis = this;
mHandler.postDelayed(new Runnable() {
@Override
public void run() {
finalThis.checkConnectionForChromebookIssue();
}
}, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
// final HIDDeviceBLESteamController finalThis = this;
// mHandler.postDelayed(new Runnable() {
// @Override
// public void run() {
// finalThis.checkConnectionForChromebookIssue();
// }
// }, CHROMEBOOK_CONNECTION_CHECK_INTERVAL);
}

public String getIdentifier() {
Expand Down
Expand Up @@ -730,7 +730,7 @@ boolean sendCommand(int command, Object data) {
}
}

if (bShouldWait) {
if (bShouldWait && (SDLActivity.getContext() != null)) {
// We'll wait for the surfaceChanged() method, which will notify us
// when called. That way, we know our current size is really the
// size we need, instead of grabbing a size that's still got
Expand Down Expand Up @@ -1026,6 +1026,9 @@ public static boolean isTablet() {
* This method is called by SDL using JNI.
*/
public static boolean isChromebook() {
if (getContext() == null) {
return false;
}
return getContext().getPackageManager().hasSystemFeature("org.chromium.arc.device_management");
}

Expand Down
1 change: 1 addition & 0 deletions src/hidapi/ios/hid.m
Expand Up @@ -282,6 +282,7 @@ - (int)updateConnectedSteamControllers:(BOOL) bForce
NSLog( @"connected peripheral: %@", peripheral );
if ( [peripheral.name isEqualToString:@"SteamController"] )
{
self.nPendingPairs += 1;
HIDBLEDevice *steamController = [[HIDBLEDevice alloc] initWithPeripheral:peripheral];
[self.deviceMap setObject:steamController forKey:peripheral];
[self.centralManager connectPeripheral:peripheral options:nil];
Expand Down
4 changes: 3 additions & 1 deletion src/joystick/iphoneos/SDL_sysjoystick.m
Expand Up @@ -24,7 +24,7 @@
#include "SDL_sysjoystick_c.h"

/* needed for SDL_IPHONE_MAX_GFORCE macro */
#include "SDL_config_iphoneos.h"
#include "../../../include/SDL_config_iphoneos.h"

#include "SDL_assert.h"
#include "SDL_events.h"
Expand Down Expand Up @@ -131,7 +131,9 @@ @interface GCMicroGamepad (SDL)
GCExtendedGamepad *gamepad = controller.extendedGamepad;
BOOL is_xbox = [controller.vendorName containsString: @"Xbox"];
BOOL is_ps4 = [controller.vendorName containsString: @"DUALSHOCK"];
#if TARGET_OS_TV
BOOL is_MFi = (!is_xbox && !is_ps4);
#endif
int nbuttons = 0;

/* These buttons are part of the original MFi spec */
Expand Down
1 change: 1 addition & 0 deletions src/video/cocoa/SDL_cocoaevents.m
Expand Up @@ -21,6 +21,7 @@
#include "../../SDL_internal.h"

#if SDL_VIDEO_DRIVER_COCOA

#include "SDL_timer.h"

#include "SDL_cocoavideo.h"
Expand Down
6 changes: 4 additions & 2 deletions src/video/cocoa/SDL_cocoametalview.h
Expand Up @@ -24,14 +24,16 @@
* Thanks to Alex Szpakowski, @slime73 on GitHub, for his gist showing
* how to add a CAMetalLayer backed view.
*/
#include "../../SDL_internal.h"

#ifndef SDL_cocoametalview_h_
#define SDL_cocoametalview_h_

#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL)

#import "../SDL_sysvideo.h"
#import "SDL_cocoawindow.h"

#if SDL_VIDEO_DRIVER_COCOA && (SDL_VIDEO_VULKAN || SDL_VIDEO_METAL)
#import "SDL_cocoawindow.h"

#import <Cocoa/Cocoa.h>
#import <Metal/Metal.h>
Expand Down
1 change: 0 additions & 1 deletion src/video/cocoa/SDL_cocoavulkan.m
Expand Up @@ -23,7 +23,6 @@
* @author Mark Callow, www.edgewise-consulting.com. Based on Jacob Lifshay's
* SDL_x11vulkan.c.
*/

#include "../../SDL_internal.h"

#if SDL_VIDEO_VULKAN && SDL_VIDEO_DRIVER_COCOA
Expand Down
4 changes: 2 additions & 2 deletions src/video/uikit/SDL_uikitviewcontroller.m
Expand Up @@ -341,8 +341,8 @@ - (void)viewWillTransitionToSize:(CGSize)size withTransitionCoordinator:(id<UIVi
rotatingOrientation = YES;
[coordinator animateAlongsideTransition:^(id<UIViewControllerTransitionCoordinatorContext> context) {}
completion:^(id<UIViewControllerTransitionCoordinatorContext> context) {
rotatingOrientation = NO;
}];
self->rotatingOrientation = NO;
}];
}
#else
- (void)willRotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation duration:(NSTimeInterval)duration {
Expand Down

0 comments on commit c9c8978

Please sign in to comment.