Git Product home page Git Product logo

basic_wm's People

Contributors

jichu4n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

basic_wm's Issues

Nothing happens when I do these

Alt + Left Click: Move window
Alt + Right Click: Resize window
Alt + F4: Close window
Alt + Tab: Switch window

ctrl+shift grabs mouse and keyboard showing in Xephyr window title

I am dumb, error with Glog.

/usr/bin/ld: /tmp/ccaISolJ.o: in function `main':
main.cpp:(.text+0x2a): undefined reference to `google::InitGoogleLogging(char const*)'
/usr/bin/ld: main.cpp:(.text+0x66): undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: main.cpp:(.text+0x72): undefined reference to `google::LogMessage::stream()'
/usr/bin/ld: main.cpp:(.text+0x8d): undefined reference to `google::LogMessage::~LogMessage()'
/usr/bin/ld: main.cpp:(.text+0xdb): undefined reference to `google::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/ccRXsZzt.o: in function `WindowManager::Create()':
window_manager.cpp:(.text+0x22): undefined reference to `XOpenDisplay'
/usr/bin/ld: window_manager.cpp:(.text+0x4a): undefined reference to `google::LogMessage::LogMessage(char const*, int, int)'
/usr/bin/ld: window_manager.cpp:(.text+0x56): undefined reference to `google::LogMessage::stream()'
/usr/bin/ld: window_manager.cpp:(.text+0x72): undefined reference to `XDisplayName'
/usr/bin/ld: window_manager.cpp:(.text+0x89): undefined reference to `google::LogMessage::~LogMessage()'
/usr/bin/ld: window_manager.cpp:(.text+0xda): undefined reference to `google::LogMessage::~LogMessage()'
/usr/bin/ld: /tmp/ccRXsZzt.o: in function `WindowManager::~WindowManager()':
window_manager.cpp:(.text+0x1a7): undefined reference to `XCloseDisplay'
/usr/bin/ld: /tmp/ccRXsZzt.o: in function `_XDisplay*& google::CheckNotNull<_XDisplay*&>(char const*, int, char const*, _XDisplay*&)':
window_manager.cpp:(.text._ZN6google12CheckNotNullIRP9_XDisplayEET_PKciS6_OS4_[_ZN6google12CheckNotNullIRP9_XDisplayEET_PKciS6_OS4_]+0x86): undefined reference to `google::LogMessageFatal::LogMessageFatal(char const*, int, google::CheckOpString const&)'
/usr/bin/ld: window_manager.cpp:(.text._ZN6google12CheckNotNullIRP9_XDisplayEET_PKciS6_OS4_[_ZN6google12CheckNotNullIRP9_XDisplayEET_PKciS6_OS4_]+0x92): undefined reference to `google::LogMessageFatal::~LogMessageFatal()'
collect2: error: ld returned 1 exit status

help

Thicker border at top of window, colour problems

I am successfully getting the border at the top thicker, however it's colour is the same as the window background, I want it ti be the same has the border colour.
Here's my windowManager::Frame

void WindowManager::Frame(Window w, bool was_created_before_window_manager) {
  // Visual properties of the frame to create.
  const unsigned int BORDER_WIDTH = 3;
  const unsigned long BORDER_COLOR = 0x80808080; //0xff0000;
  const unsigned long BG_COLOR = 0xFFFFFFF; //0x0000ff;

  // We shouldn't be framing windows we've already framed.
  CHECK(!clients_.count(w));

  // 1. Retrieve attributes of window to frame.
  XWindowAttributes x_window_attrs;
  CHECK(XGetWindowAttributes(display_, w, &x_window_attrs));

  // 2. If window was created before window manager started, we should frame
  // it only if it is visible and doesn't set override_redirect.
  if (was_created_before_window_manager) {
    if (x_window_attrs.override_redirect ||
        x_window_attrs.map_state != IsViewable) {
      return;
    }
  }

  // 3. Create frame.
  const Window frame = XCreateSimpleWindow(
      display_,
      root_,
      x_window_attrs.x,
      x_window_attrs.y,
      x_window_attrs.width,
      x_window_attrs.height + BORDER_WIDTH + BORDER_WIDTH * BORDER_WIDTH * 2,
      BORDER_WIDTH,
      BORDER_COLOR,
      BG_COLOR);

  // 4. Select events on frame.
  XSelectInput(
      display_,
      frame,
      SubstructureRedirectMask | SubstructureNotifyMask);
  // 5. Add client to save set, so that it will be restored and kept alive if we
  // crash.
  XAddToSaveSet(display_, w);
  // 6. Reparent client window.
  XReparentWindow(
      display_,
      w,
      frame,
      0, 0+BORDER_WIDTH + BORDER_WIDTH * BORDER_WIDTH * 2);  // Offset of client window within frame.
  // 7. Map frame.
  XMapWindow(display_, frame);
  // 8. Save frame handle.
  clients_[w] = frame;
  // 9. Grab universal window management actions on client window.
  //   a. Move windows with alt + left button.
  XGrabButton(
      display_,
      Button1,
      Mod1Mask,
      w,
      false,
      ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
      GrabModeAsync,
      GrabModeAsync,
      None,
      None);
  //   b. Resize windows with alt + right button.
  XGrabButton(
      display_,
      Button3,
      Mod1Mask,
      w,
      false,
      ButtonPressMask | ButtonReleaseMask | ButtonMotionMask,
      GrabModeAsync,
      GrabModeAsync,
      None,
      None);
  //   c. Kill windows with alt + f4.
  XGrabKey(
      display_,
      XKeysymToKeycode(display_, XK_F4),
      Mod1Mask,
      w,
      false,
      GrabModeAsync,
      GrabModeAsync);
  //   d. Switch windows with alt + tab.
  XGrabKey(
      display_,
      XKeysymToKeycode(display_, XK_Tab),
      Mod1Mask,
      w,
      false,
      GrabModeAsync,
      GrabModeAsync);

  LOG(INFO) << "Framed window " << w << " [" << frame << "]";
}

Now I need to somehow fill the space at the top with a filled rectangle with the border colour

Links to articles invalid

Hello sir, I can't appear to access the entirety of your series because the links to parts 2 and 3 are broken. Is there another place I can read your articles? Would love to follow along to help me with my implementation of re-creating Microsoft's power toys fancyzones :-)

Shortcuts not working

I do CTRL + SHIFT to grab mouse/keyboard, but when i do the shortcuts in the README, nothing happen

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.