Skip to content

Instantly share code, notes, and snippets.

@niw
Created July 2, 2011 05:34
Show Gist options
  • Save niw/1059761 to your computer and use it in GitHub Desktop.
Save niw/1059761 to your computer and use it in GitHub Desktop.
Mozc r57 patch
Index: renderer/mac/CandidateController.mm
===================================================================
--- renderer/mac/CandidateController.mm (revision 57)
+++ renderer/mac/CandidateController.mm (working copy)
@@ -91,6 +91,25 @@
}
}
+ // Make a visible rect which doesn't include Dock and menu bar area.
+ CGRect mainDisplayRect = CGDisplayBounds(CGMainDisplayID());
+ for (NSScreen *screen in [NSScreen screens]) {
+ // Lookup NSScreen for the specific displayID.
+ NSDictionary *deviceDescription = [screen deviceDescription];
+ NSNumber *screenNumber = [deviceDescription objectForKey:@"NSScreenNumber"];
+ if (screenNumber &&
+ displayID == (CGDirectDisplayID)[screenNumber intValue]) {
+ // This NSRect is using the left-bottom of main screen as its origin.
+ // renderer::Rect is using top-left, so need to convert it.
+ NSRect rect = [screen visibleFrame];
+ CGFloat y = mainDisplayRect.size.height - rect.origin.y -
+ rect.size.height;
+ return renderer::Rect(rect.origin.x, y,
+ rect.size.width, rect.size.height);
+ }
+ }
+
+ // should not reach here.
CGRect display_rect = CGDisplayBounds(displayID);
return renderer::Rect(display_rect.origin.x, display_rect.origin.y,
display_rect.size.width, display_rect.size.height);
Index: build_mozc.py
===================================================================
--- build_mozc.py (revision 57)
+++ build_mozc.py (working copy)
@@ -773,6 +773,8 @@
'-configuration', options.configuration,
'-target', target_name,
'-parallelizeTargets',
+ '-sdk', 'macosx',
+ 'GCC_SYMBOLS_PRIVATE_EXTERN=1',
'BUILD_WITH_GYP=1'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment