summaryrefslogtreecommitdiff
path: root/src
AgeCommit message (Collapse)Author
2017-09-17keymap_free can be staticJérémie Courrèges-Anglas
2017-09-17Turn utf8 macros into functions with less ugly namesJérémie Courrèges-Anglas
2017-09-17Move RP_IS_UTF8_* macros in utf8.hJérémie Courrèges-Anglas
Only used in editor.c when introduced, but they're used elsewhere since.
2017-09-17copyright+licenseJérémie Courrèges-Anglas
2017-09-17Shuffle some codeJérémie Courrèges-Anglas
2017-09-17Move utf8_locale setting in utf8.cJérémie Courrèges-Anglas
Less goo in main.c
2017-09-17Update .gitignoreJérémie Courrèges-Anglas
2017-09-17Initialize utf8_locale in main(), it doesn't belong in defaults nowJérémie Courrèges-Anglas
2017-09-17Simplify ratpoison -c realloc loopJérémie Courrèges-Anglas
2017-09-17Move the sbuf_utf8_nconcat test to its own fileJérémie Courrèges-Anglas
2017-09-17Move fatal() and x* helpers to their own fileJérémie Courrèges-Anglas
Should help use them from within tests.
2017-09-17Move utf8_locale to its own fileJérémie Courrèges-Anglas
So that we can easily use it from tests.
2017-09-17Rename concat_width to sbuf_utf8_nconcat, and move it to sbuf.cJérémie Courrèges-Anglas
This function appends n UTF-8 characters to its sbuf parameter. Falls back to bytes in a non-UTF-8 locale. If width = -1, it appends the whole input string.
2017-09-17Add a test program to exercise concat_width()Will Storey
This program can be run using `make check`. In order to do this, you will need to run `autogen.sh` again.
2017-09-17Handle UTF-8 in concat_width()Jérémie Courrèges-Anglas
Ensure that we don't truncate UTF-8 characters in %42s-style format strings. Prompted by a similar diff by Will Storey <will@summercat.com>, that made use of the wide char API. I find it simpler to just handle UTF-8.
2017-08-28Move several functions out of main.c into globals.cWill Storey
These functions are used in many parts of ratpoison. In order to compile a separate program using the ratpoison files, we need them available outside of main.c.
2017-08-28add onlyborder variableVasil Zlatanov
When onlyborder is set to 0 (default 1), borders are not displayed if there is only a single frame on a given screen. This is useful if you use (thick) coloured borders to show which is the currently focused window when using splits, but also don't want to have borders taking up space unnecessarily when running a fullscreen window. Signed-off-by: Vasil Zlatanov <v@skozl.com>
2017-08-21Fix: sync wins correctly after tmpwm for multiple screensAntoine Busque
The current implementation of `sync_wins`, which gets called after control is returned to ratpoison following a call to `tmpwm`, gets executed once per screen. This is not only unnecesary, but also causes ratpoison to break after returning from `tmpwm`. This is due to two things: first, we can scan for the windows in only one pass, because the call to `XQueryTree` returns all windows below the root window, which is shared across the screens. Second, the current implementation only checks whether a window is a special ratpoison window (i.e. the key window, bar window, etc.) for the current screen. This results in some windows being mapped although they shouldn't be, which is what causes the break preventing ratpoison from receiving commands correctly, This patch fixes these issues by only running `sync_wins` once instead of on all screens, and by using the existing `is_rp_window` utility function to prevent a special ratpoison window from being mapped, regardless of the screen it belongs to. Signed-off-by: Antoine Busque <antoinebusque@gmail.com>
2017-08-07Fix: call using_history after initializing history entriesAntoine Busque
In its current state, history expansion requiring any sort of string lookup is not working, always returing "event not found". This is due to `history_offset` being set improperly by an early call to `using_history`. A call to `using_history` needs to follow, not precede, the loop performing initialization of history entries found in `history_expand_line`. This allows for `history_offset` to reflect the now non-zero length of the history, restoring the expected behaviour of history expansion. Tested-by: Martin Hertz <mvhertz@gmail.com> Signed-off-by: Antoine Busque <antoinebusque@gmail.com>
2017-07-09Always show the frame indicator when switching to a different screen.Jérémie Courrèges-Anglas
When switching to another screen, the focus{left,right,up,down} commands only show the frame indicator if the target screen has more than one frame. This behavior is kinda non-intuitive. Pointed out by Antoine Busque, who also provided a different fix.
2017-07-04Fix: check frame overlap in find_frame_left, find_frame_rightAntoine Busque
When compared with the existing overlap check in `find_frame_{up,down}`, it appears that the original implementation of the overlap test for `find_frame_{left,right}` is erroneous. Indeed, the wrong boundaries are used, which causes issues like allowing finding a frame in one direction, but not finding the frame when going back in the reverse direction. Commands like `focus{left,right}` rely on the corresponding `find_frame` function. The original boundaries check issue meant that, on differently sized screens, focus could pass from one screen to the next in one direction, but not in the other. The boundary checks have therefore been corrected to mirror those in `find_frame_{up,down}`, and check for actual overlap between the frames. Signed-off-by: Antoine Busque <antoinebusque@gmail.com>
2017-04-04@$#?! strcasestrJérémie Courrèges-Anglas
2017-04-03Fix previous.Jérémie Courrèges-Anglas
2017-04-03Avoid useless deprecation warningsJérémie Courrèges-Anglas
Looks like strcasestr was actually a GNU extension, so using _BSD_SOURCE doesn't make sense. POSIX declares it in strings.h, glibc-2.25 and older declare it in string.h if _GNU_SOURCE is defined.
2017-03-10Use file names, not paths, in error/warning/debug messagesJérémie Courrèges-Anglas
2017-03-10Tweak error message.Jérémie Courrèges-Anglas
2017-03-10Print a warning message to stdout if we hit an unknown commandJérémie Courrèges-Anglas
Should help finding typos in config files. (If use startxr, you should probably redirect stdout and stderr to ~/.xsession-errors in your ~/.xinitrc.)
2017-03-10Print a warning if a deprecated command is used.Jérémie Courrèges-Anglas
2017-03-10At init time, add unmapped windows to the default (first) screen.Jérémie Courrèges-Anglas
Kills an error message and fixes a "regression" in my setup. Previously, if xinerama was not active (disabled or screen count == 1), out-of-screen windows were added to screen 0 and were considered "managed".
2017-03-09Unused variableJérémie Courrèges-Anglas
2017-03-09Setting framemsgwait to -1 disables the 'Current frame' message.Jérémie Courrèges-Anglas
2017-02-15Merge branch 'xrandr'Jérémie Courrèges-Anglas
All the hard work on xrandr done by Mathieu OTHACEHE, thanks!
2016-12-28screen: rewrite screen_del conditionsMathieu OTHACEHE
Rewrite screen_del conditional imbrications for a better readability. No functional changes here.
2016-12-21Fix frozen state when a new screen appears after all screens have been removedMathieu OTHACEHE
Handle correctly the fact that the deleted screen could be the last one. If a screen is plugged, and no other screens are present, give focus to it's key window.
2016-12-21Add a hide_screen_windows functionMathieu OTHACEHE
This function is useful to find the windows displayed on a specific screen and hide them.
2016-12-12Update screen-aware focus* commands after changes to support XRandRJoseph Mingrone
This is an update to Pedro Silva's patch, so that it applies against the xrandr branch. That patch introduced four new functions, frame_*_abs, which report a frame's left, right, top, and bottom coordinates offset by it's screen arrangement. This allows the use of the focus* commands as additional screen navigation tools, and has the added benefit of making the find_frame_* functions clearer.
2016-12-09Unused paramJérémie Courrèges-Anglas
2016-12-09Yet another function that doesn't take arguments any moreJérémie Courrèges-Anglas
2016-12-09Dead declJérémie Courrèges-Anglas
2016-12-09no parameter -> void; C and C++ differ hereJérémie Courrèges-Anglas
2016-12-09Adapt function nameJérémie Courrèges-Anglas
2016-12-08Store RootWindow in global_screen structureMathieu OTHACEHE
Every screen stores a copy of xrandr RootWindow even if they all share the same RootWindow. This patch stores the RootWindow in a global location for all screens. Further work is required to remove RootWindow from per screen structure.
2016-12-08Select xrandr primary screen at startup if possibleMathieu OTHACEHE
If xrandr support is enabled and a screen is marked primary, use it as current screen at startup. Otherwise, use the first screen in sorted screen list as current screen at startup.
2016-12-08Simplify scanwins functionMathieu OTHACEHE
Use find_screen_by_attr function, remove screen argument and a useless debug message.
2016-12-08Add a function to find a screen matching a given XWindowAttributesMathieu OTHACEHE
It allows to find the screen associated to a Window, using it's x and y position.
2016-12-08Add primary screen detectionMathieu OTHACEHE
The user may specify that a screen is primary with xrandr. Save this information in ratpoison for future use. The use of XRRGetOutputPrimary forces us to bump xrandr supported revision from >=1.2 to >=1.3.
2016-12-08Move function declaration to the right headerMathieu OTHACEHE
find_screen is defined in screen.c so it makes more sense to declare it in screen.h
2016-12-08Remove useless argument from is_rp_window_for_screen functionMathieu OTHACEHE
The screen argument is useless as this function operates on all screens. To find if a window belong to a specific ratpoison screen, function is_rp_window_for_given_screen may be used.
2016-12-01Fix and simplify sfrestoreJérémie Courrèges-Anglas
Use a scratch buffer for each screen, this simplifies a lot allocations and iterations, and allows restoring screens that contain more than one frame.
2016-12-01sfrestore: in case of error, mention the screen number, not its xrandr idJérémie Courrèges-Anglas