-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract Display code out of OS class #23209
Conversation
bdb21c7
to
943baa2
Compare
… make it possible to overload them separately
943baa2
to
55a8bfb
Compare
I have a fix for the windows build issue CI is reporting, but it doesn't seem to be making it into this PR, due possibly to a GItHub outage (see https://status.github.com/messages). When that situation is resolved, I'll take another look. |
Nice you adapted the other platforms already! I only adapted osx and ran into problems... What is checked till now? (like actually tested, not only travis) |
Nice you already fixed all the plaforms! I only tried osx, but ran into issues. |
I've only actually tested on Freedesktop (which is all the original code worked with). Server, javascript and android all build, though javascript fails on some final step for me and gradle runs into problems for Android (both issues for me when using master as well, but they prevent me from testing). I'll give updates if I do manage to get those working. Testing would be most appreciated on OSX, IPhone and the windows platforms, as I can't build locally for them at all. |
Yep, even in the last few minutes my comments and edits have been inconsistent. Looks like they've been working through the night to fix it. Is there a way I can make CI go again with my changes, or does that happen automatically when GitHub is working? |
(I deleted my last comment because I didn't think it was really needed, woop. So that comment not appearing isn't GitHub's fault. For anyone else reading this, I basically said I'm gonna review the PR once more once GitHub isn't on the fritz.) You could make another commit, but I'd wait until GitHub's working again. |
I think we do not use multiple inheritance in general. I don't remember why (it might be because it creates problems with the classdb) but the fact that you are using it might be a problem. |
I believe all the I can see three possible alternative ways of doing things:
Edit: added 3rd option |
Well, I might be wrong but the only place where the display abstraction is needed is the freedesktop platform. So, IMHO, there is no real reason to make this abstraction elsewhere unless it clearly make the code easier to read and to use. Personally, I would keep the API as is for the OS class, and only call an x11 driver class from the freedesktop OS class. (But, to be honest I am not the most qualified one in this part of the code ^^) Edit: Basically, what I wrote is your solution number two. ^^ |
Different Topic (Naming conventions): Is it good design to call classes |
@@ -87,9 +87,9 @@ Copyright: 2002, Google Inc. | |||
License: Apache-2.0 | |||
|
|||
Files: ./platform/android/power_android.cpp | |||
./platform/freedesktop/power_x11.cpp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just being a little nitpicky here, but if we're renaming the x11
platform to freedesktop
, shouldn't the filenames be changed too?:
@@ -0,0 +1,360 @@ | |||
#!/usr/bin/env python | |||
# -*- coding: utf-8 -*- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`makemd.py was removed from master some time ago for being an unused script.
#include "core/os/os.h" | ||
#include "core/project_settings.h" | ||
#include "drivers/gl_context/context_gl.h" | ||
#include <string.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line was removed from master some time ago.
// virtual void set_window_always_on_top(bool p_enabled) {} | ||
// virtual bool is_window_always_on_top() const { return false; } | ||
// virtual void request_attention() {} | ||
// virtual void center_window(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you're removing all this stuff from os.cpp
, I don't see a need to keep commented-out headers.
@@ -0,0 +1 @@ | |||
/home/wmww/code/gdmir/module/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think you meant to commit this file either, nor modules/stytd6U8
.
@@ -0,0 +1,6 @@ | |||
#!/usr/bin/env python |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was moved to a different location in master some time ago.
Sorry for the large number of comments, I believe I'm done reviewing for now. A couple other things I noted:
(Also, I feel the need to point out that I won't be reviewing the code itself to make sure it works, or commenting on any design choices -- I'm leaving that up to other, more knowledgeable people. I'm simply pointing out the little things that I noticed, as my many comments above should show. So please, take all of this as you will. :) ) |
Co-Authored-By: wmww <[email protected]>
Thanks! All those comments seem valid. I'll go through and fix them one by one, but only if others decide its a good idea to go forward with the current design. Otherwise, many of them may not be relevant (or I might just end up rewriting the whole thing). |
Update: @wmww and me had a call. Conclusion: we should use option 3 where os_wayland and os_x11 are different classes both inheriting from os_linux (os_freedesktop) We check if a connection to a wayland composition is possible than instance the os_wayland class otherwise it will run on x11. advantages:
display = wl_display_connect(NULL);
if (display == NULL) {
NO WAYLAND
}
WAYLAND than the correct os gets initialised... |
I would like to implement this abstraction, by just making two seperated classes. (as i explained in the last post) (summerized: No DisplayDriver class/singleton) I just need green light, to be sure im not overlooking anything. |
Moving to #23425 |
This is based on #16744 by @hpvb. If there's a better way to architect it, let me know.