summaryrefslogtreecommitdiff
path: root/src/drivers/Cocoa
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-04-19 06:34:40 +0000
committerManolo Gouy <Manolo>2016-04-19 06:34:40 +0000
commit366f4bfbc9e6d71e7b5fccf6d666d5dd3cab600c (patch)
tree2773f44a324655a262a29e176b48965ee37611bc /src/drivers/Cocoa
parentc0f14ca2f00b1ea026298b0efa91c8b6afb13244 (diff)
Move the set_key_window() member function from class Fl_X to class Fl_Cocoa_Window_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers/Cocoa')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx3
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H1
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx3
3 files changed, 4 insertions, 3 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
index 8c3f47d47..d4054affc 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
+++ b/src/drivers/Cocoa/Fl_Cocoa_Screen_Driver.cxx
@@ -19,6 +19,7 @@
#include "../../config_lib.h"
#include "Fl_Cocoa_Screen_Driver.H"
+#include "Fl_Cocoa_Window_Driver.H"
#include "../Quartz/Fl_Font.H"
#include <FL/Fl.H>
#include <FL/x.H>
@@ -167,7 +168,7 @@ void Fl_Cocoa_Screen_Driver::grab(Fl_Window* win)
if (win) {
if (!Fl::grab_) {
fl_capture = Fl_X::i(Fl::first_window())->xid;
- Fl_X::i(Fl::first_window())->set_key_window();
+ ((Fl_Cocoa_Window_Driver*)Fl::first_window()->driver())->set_key_window();
}
Fl::grab_ = win;
} else {
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
index 5b0bba2f9..caf705cbe 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
@@ -73,6 +73,7 @@ public:
CGContextRef gc; // graphics context
NSCursor *cursor;
static void q_release_context(Fl_Cocoa_Window_Driver *x = 0); // free all resources associated with gc
+ void set_key_window();
// --- window data
virtual int decorated_w();
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx
index 68389bae9..df1bb114e 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx
+++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.cxx
@@ -53,8 +53,7 @@ Fl_Cocoa_Window_Driver::~Fl_Cocoa_Window_Driver()
void Fl_Cocoa_Window_Driver::take_focus()
{
- Fl_X *x = Fl_X::i(pWindow);
- if (x) x->set_key_window();
+ set_key_window();
}