(How to disable the title bar of a window (undecorated window))
 
Line 41: Line 41:
 
Tested on linux mint 18.3 & of v0.9.8
 
Tested on linux mint 18.3 & of v0.9.8
  
[[Category:openframeworks]]
+
[[Category:openframeworks.cc]]
 
[[Category:tip]]
 
[[Category:tip]]
 
[[Category:c++]]
 
[[Category:c++]]

Latest revision as of 20:44, 7 November 2018

How to disable the title bar of a window (undecorated window)

effect - the grey rectangle is the openframeworks window:

Openframeworks undecorated window.png

This tip depends on the renderer you are using! As i'm running linux (on a crappy computer, not sure it is valid for any linux-hardware rig), i had to modify the method setup in [OF_ROOT]/lib/openFrameworks/app/ofAppGLFWWindow.cpp.

  1. ofAppGLFWWindow::setup(const ofGLFWWindowSettings & _settings) {
  2. ...
  3. glfwDefaultWindowHints();
  4. //glfwWindowHint(GLFW_DECORATED, settings.decorated); // comment this line
  5. glfwWindowHint(GLFW_DECORATED, GL_FALSE); // force DECORATED to false

Then you have to recompile OF. Once again, i'm running linux so i just to do:

  1. $ [OF_ROOT]/scripts/linux/./compileOF.sh

To view the result, just clean and recompile any app using OF: done!

All methods to manipulate the window are listed in [OF_ROOT]/lib/openFrameworks/app/ofAppRunner.cpp.

  1. bool ofDoesHWOrientation();
  2. ofPoint ofGetWindowSize();
  3. ofRectangle ofGetWindowRect()
  4. ofAppBaseWindow * ofGetWindowPtr();
  5. void ofSetWindowPosition(int x, int y);
  6. void ofSetWindowShape(int width, int height);
  7. void ofSetWindowTitle(string title);
  8. void ofEnableSetupScreen();
  9. void ofDisableSetupScreen();
  10. void ofSetFullscreen(bool fullscreen);
  11. void ofToggleFullscreen();

You can also get the native objects, depending on the OS:

  1. Display* ofGetX11Display();
  2. Window ofGetX11Window();

Tested on linux mint 18.3 & of v0.9.8

online identity ∋ [ social ∋ [mastodon♥, twitter®, facebook®, diaspora, linkedin®] ∥ repos ∋ [github®, gitlab♥, bitbucket®, sourceforge] ∥ media ∋ [itch.io®, vimeo®, peertube♥, twitch.tv®, tumblr®] ∥ communities ∋ [godotengine♥, openprocessing, stackoverflow, threejs]]