Update fullscreen background color immediately

It is no longer necessary to exit and re-enter fullscreen to see changes
to the "background" setting in 'fopt'.
This commit is contained in:
Bjorn Winckler
2008-09-16 22:51:08 +02:00
parent bdb7f8efa6
commit def2d1a9e4
10 changed files with 44 additions and 0 deletions
+1
View File
@@ -111,6 +111,7 @@
- (void)enterFullscreen:(int)fuoptions background:(int)bg;
- (void)leaveFullscreen;
- (void)setFullscreenBackgroundColor:(int)color;
- (void)setAntialias:(BOOL)antialias;
+9
View File
@@ -1019,6 +1019,15 @@ static NSString *MMSymlinkWarningString =
[self queueMessage:LeaveFullscreenMsgID data:nil];
}
- (void)setFullscreenBackgroundColor:(int)color
{
NSMutableData *data = [NSMutableData data];
color = MM_COLOR(color);
[data appendBytes:&color length:sizeof(int)];
[self queueMessage:SetFullscreenColorMsgID data:data];
}
- (void)setAntialias:(BOOL)antialias
{
int msgid = antialias ? EnableAntialiasMsgID : DisableAntialiasMsgID;
+5
View File
@@ -923,6 +923,11 @@ static BOOL isUnsafeMessage(int msgid);
}
} else if (CloseWindowMsgID == msgid) {
[self scheduleClose];
} else if (SetFullscreenColorMsgID == msgid) {
const int *bg = (const int*)[data bytes];
NSColor *color = [NSColor colorWithRgbInt:bg];
[windowController setFullscreenBackgroundColor:color];
// IMPORTANT: When adding a new message, make sure to update
// isUnsafeMessage() if necessary!
} else {
+2
View File
@@ -62,6 +62,8 @@
- (void)enterFullscreen:(int)fuoptions backgroundColor:(NSColor *)back;
- (void)leaveFullscreen;
- (void)setFullscreenBackgroundColor:(NSColor *)back;
- (void)setBuffersModified:(BOOL)mod;
- (IBAction)addNewTab:(id)sender;
+6
View File
@@ -571,6 +571,12 @@
shouldResizeVimView = YES;
}
- (void)setFullscreenBackgroundColor:(NSColor *)back
{
if (fullscreenEnabled)
[fullscreenWindow setBackgroundColor:back];
}
- (void)setBuffersModified:(BOOL)mod
{
// NOTE: We only set the document edited flag on the decorated window since
+1
View File
@@ -174,6 +174,7 @@ enum {
OpenWithArgumentsMsgID,
CloseWindowMsgID,
InterruptMsgID,
SetFullscreenColorMsgID,
};
+1
View File
@@ -81,6 +81,7 @@ char *MessageStrings[] =
"OpenWithArgumentsMsgID",
"CloseWindowMsgID",
"InterruptMsgID",
"SetFullscreenColorMsgID",
};
+14
View File
@@ -1599,6 +1599,20 @@ gui_mch_leave_fullscreen()
}
void
gui_mch_fuopt_update()
{
guicolor_T fg, bg;
if (fuoptions_flags & FUOPT_BGCOLOR_HLGROUP) {
syn_id2colors(fuoptions_bgcolor, &fg, &bg);
} else {
bg = fuoptions_bgcolor;
}
[[MMBackend sharedInstance] setFullscreenBackgroundColor:bg];
}
void
gui_macvim_update_modified_flag()
{
+4
View File
@@ -10875,6 +10875,10 @@ check_fuoptions(p_fuoptions, flags, bgcolor)
*flags = new_fuoptions_flags;
*bgcolor = new_fuoptions_bgcolor;
/* Let the GUI know, in case the background color has changed. */
gui_mch_fuopt_update();
return OK;
}
#endif
+1
View File
@@ -192,6 +192,7 @@ int serverSendReply(char_u *serverid, char_u *str);
void gui_mch_enter_fullscreen(int fuoptions_flags, guicolor_T bg);
void gui_mch_leave_fullscreen(void);
void gui_mch_fuopt_update(void);
void gui_macvim_update_modified_flag();
void gui_macvim_add_to_find_pboard(char_u *pat);